add a check for the return of OBJ_new_nid()
@@ -758,6 +758,9 @@ int OBJ_create(const char *oid, const char *sn, const char *ln)
}
tmpoid->nid = OBJ_new_nid(1);
+ if (tmpoid->nid == NID_undef)
+ goto err;
+
tmpoid->sn = (char *)sn;
tmpoid->ln = (char *)ln;
