crypto: fix leak in SafeX509ExtPrint
authorFedor Indutny <fedor@indutny.com>
Sat, 7 Mar 2015 03:51:03 +0000 (22:51 -0500)
committerFedor Indutny <fedor@indutny.com>
Sat, 7 Mar 2015 12:58:31 +0000 (07:58 -0500)
`ASN1_item_d2i`'s return value must be freed by the owner.

Fix: https://github.com/iojs/io.js/issues/1075
PR-URL: https://github.com/iojs/io.js/pull/1087
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
src/node_crypto.cc

index 9123207..a650d4f 100644 (file)
@@ -1132,6 +1132,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) {
       X509V3_EXT_val_prn(out, nval, 0, 0);
     }
   }
+  sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free);
 
   return true;
 }