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 d726c8d3a87c6fd18ce064473e85e9a59be8c6ad..4d07dc043b81286ebbd8e8e85f79d6851b4a00e5 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);
                        }