]> granicus.if.org Git - php/commitdiff
Fix for Bug #29418 (double free when openssl_csr_new fails).
authorWez Furlong <wez@php.net>
Tue, 26 Oct 2004 09:28:34 +0000 (09:28 +0000)
committerWez Furlong <wez@php.net>
Tue, 26 Oct 2004 09:28:34 +0000 (09:28 +0000)
Also hook up MSHUTDOWN function which appears to have never been enabled.

Patch by Kamesh Jayachandran

ext/openssl/openssl.c

index 3d8665b623f3378d31da048fac8b1478b7b06f52..091b14ff772a51e226601317f3323bae51998f7a 100644 (file)
@@ -135,7 +135,7 @@ zend_module_entry openssl_module_entry = {
        "openssl",
        openssl_functions,
        PHP_MINIT(openssl),
-       NULL,
+       PHP_MSHUTDOWN(openssl),
        NULL,
        NULL,
        PHP_MINFO(openssl),
@@ -1675,6 +1675,12 @@ PHP_FUNCTION(openssl_csr_new)
                                                }
                                        }
                                }
+                               else {
+                                       if (!we_made_the_key) {
+                                               /* if we have not made the key we are not supposed to zap it by calling dispose! */
+                                               req.priv_key = NULL;
+                                       }
+                               }
                        }
                }
        }