Check for FindNextFile when defining it rather than FindFirstFile
[oweals/openssl.git] / crypto / asn1 / evp_asn1.c
index 162b37bc38a9972d6235bcdb36529b34bf165def..1b9445973e49e803f57d2e927bff7a0b9f12704b 100644 (file)
@@ -66,7 +66,11 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
        ASN1_STRING *os;
 
        if ((os=M_ASN1_OCTET_STRING_new()) == NULL) return(0);
-       if (!M_ASN1_OCTET_STRING_set(os,data,len)) return(0);
+       if (!M_ASN1_OCTET_STRING_set(os,data,len))
+               {
+               M_ASN1_OCTET_STRING_free(os);
+               return 0;
+               }
        ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,os);
        return(1);
        }
@@ -115,7 +119,11 @@ int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data,
 
        if ((osp=ASN1_STRING_new()) == NULL) return(0);
        /* Grow the 'string' */
-       ASN1_STRING_set(osp,NULL,size);
+       if (!ASN1_STRING_set(osp,NULL,size))
+               {
+               ASN1_STRING_free(osp);
+               return(0);
+               }
 
        M_ASN1_STRING_length_set(osp, size);
        p=M_ASN1_STRING_data(osp);