]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorJakub Zelenka <bukka@php.net>
Sun, 4 Jun 2017 17:11:49 +0000 (18:11 +0100)
committerJakub Zelenka <bukka@php.net>
Sun, 4 Jun 2017 17:11:49 +0000 (18:11 +0100)
1  2 
ext/openssl/openssl.c

index 77897a2f44427b1bae034f20e5bcbaed6c9b57e0,6b382ba6bd72afac090d7a056feb47affa902cd1..f9d022a65758e3ca424ba248176bcdf5c0ddbbe7
@@@ -874,15 -852,15 +879,17 @@@ static void add_assoc_name_entry(zval 
                                        zend_hash_str_update(Z_ARRVAL(subitem), sname, strlen(sname), &tmp);
                                }
                        } else {
+                               /* it might be better to expand it and pass zval from ZVAL_STRING
+                                * to zend_symtable_str_update so we do not silently drop const
+                                * but we need a test to cover this part first */
                                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) */
-                       OPENSSL_free(to_add);
+               if (to_add_buf != NULL) {
+                       OPENSSL_free(to_add_buf);
                }
        }