Fix memory leaks in CTLOG_new_from_base64
[openssl.git] / crypto / objects / obj_dat.c
index 259851bc00960a86b3201da8d1c7504e36ace5ff..2f86cd5e46088cabd41b86d038b2b6cee612d4db 100644 (file)
@@ -676,7 +676,6 @@ int OBJ_create_objects(BIO *in)
             return (num);
         num++;
     }
-    /* return(num); */
 }
 
 int OBJ_create(const char *oid, const char *sn, const char *ln)
@@ -692,6 +691,8 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
 
     /* Convert numerical OID string to an ASN1_OBJECT structure */
     tmpoid = OBJ_txt2obj(oid, 1);
+    if (tmpoid == NULL)
+        return 0;
 
     /* If NID is not NID_undef then object already exists */
     if (OBJ_obj2nid(tmpoid) != NID_undef) {