SetBlob: free rgSetBlob on error path
authorJonas Maebe <jonas.maebe@elis.ugent.be>
Mon, 2 Dec 2013 21:34:20 +0000 (22:34 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Fri, 15 Aug 2014 20:35:11 +0000 (22:35 +0200)
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/asn1/a_set.c

index d726c8d..4d07dc0 100644 (file)
@@ -143,6 +143,7 @@ SetBlob
         qsort( rgSetBlob, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB), SetBlobCmp);
                if (!(pTempMem = OPENSSL_malloc(totSize)))
                        {
+                       OPENSSL_free(rgSetBlob);
                        ASN1err(ASN1_F_I2D_ASN1_SET,ERR_R_MALLOC_FAILURE);
                        return(0);
                        }