The correct PERL interpreter is passed via commandline.
[oweals/openssl.git] / crypto / objects / obj_dat.c
index cf21ea337772f87e9dcb52f232442fa519350df9..3ff64bb8d13ffda597929f1cea53c2fcea947220 100644 (file)
@@ -236,7 +236,7 @@ int OBJ_add_object(const ASN1_OBJECT *obj)
        if (added == NULL)
                if (!init_added()) return(0);
        if ((o=OBJ_dup(obj)) == NULL) goto err;
-       ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
+       if (!(ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ)))) goto err;
        if ((o->length != 0) && (obj->data != NULL))
                ao[ADDED_DATA]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
        if (o->sn != NULL)
@@ -445,8 +445,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
                return(0);
        }
 
-       nid=OBJ_obj2nid(a);
-       if ((nid == NID_undef) || no_name) {
+       if (no_name || (nid=OBJ_obj2nid(a)) == NID_undef) {
                len=a->length;
                p=a->data;