]> granicus.if.org Git - php/commitdiff
Fixed possible un-initialized var on error.
authorIlia Alshanetsky <iliaa@php.net>
Sun, 6 Feb 2005 22:58:46 +0000 (22:58 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 6 Feb 2005 22:58:46 +0000 (22:58 +0000)
ext/standard/exec.c

index 11bb365f65ef6d1e74e46309953a02bad6125397..1dbd638b5212c4ba68c2d76b5fbc972a6fff8bde 100644 (file)
@@ -66,7 +66,7 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
        php_stream *stream;
        size_t buflen, bufl = 0;
 #if PHP_SIGCHILD
-       void (*sig_handler)();
+       void (*sig_handler)() = NULL;
 #endif
 
        if (PG(safe_mode)) {
@@ -177,7 +177,9 @@ int php_exec(int type, char *cmd, pval *array, pval *return_value TSRMLS_DC)
 
 done:
 #if PHP_SIGCHILD
-       signal (SIGCHLD, sig_handler);
+       if (sig_handler) {
+               signal(SIGCHLD, sig_handler);
+       }
 #endif
        if (d) {
                efree(d);