From: Joe Watkins Date: Sat, 7 Jan 2017 10:15:15 +0000 (+0000) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.1.2RC1~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ae45ef99374b02a676faaad5384ec8c0784d185;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: Fix memleaks from #1755 and some pre-existing ones --- 5ae45ef99374b02a676faaad5384ec8c0784d185 diff --cc ext/openssl/openssl.c index 183a586a01,d7091b8e42..cb34077362 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@@ -871,10 -705,14 +874,16 @@@ static void add_assoc_name_entry(zval } else { add_assoc_stringl(&subitem, sname, (char *)to_add, to_add_len); } + } else { + php_openssl_store_errors(); } + + if (needs_free) { + /* ASN1_STRING_to_UTF8(3): The buffer out should be freed using free(3) */ + free(to_add); + } } + if (key != NULL) { zend_hash_str_update(Z_ARRVAL_P(val), key, strlen(key), &subitem); }