]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorJoe Watkins <krakjoe@php.net>
Sat, 7 Jan 2017 10:15:15 +0000 (10:15 +0000)
committerJoe Watkins <krakjoe@php.net>
Sat, 7 Jan 2017 10:15:15 +0000 (10:15 +0000)
* PHP-7.0:
  Fix memleaks from #1755 and some pre-existing ones

1  2 
ext/openssl/openssl.c

index 183a586a015972d38a12e86bbb42a945e4635711,d7091b8e42c89be7e0f96bfb323cb1a4db11c108..cb3407736275bb3f4db7de8a69e1611eceb2bde0
@@@ -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);
        }