]> granicus.if.org Git - php/commitdiff
Fixed possible memory leak
authorDmitry Stogov <dmitry@php.net>
Thu, 11 Aug 2011 06:38:42 +0000 (06:38 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 11 Aug 2011 06:38:42 +0000 (06:38 +0000)
sapi/cgi/cgi_main.c

index b11785f1a8e5319b4c5eef8df8a143ed00d37d25..0e108af6fac9a1a8f81b37745d57d03b384abee9 100644 (file)
@@ -725,7 +725,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
 
        /* Check whether cache entry has expired and rescan if it is */
        if (request_time > entry->expires) {
-               char * real_path;
+               char *real_path = NULL;
                int real_path_len;
                char *s1, *s2;
                int s_len;
@@ -774,6 +774,9 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
                        php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC);
                }
 
+               if (real_path) {
+                       free(real_path);
+               }
                entry->expires = request_time + PG(user_ini_cache_ttl);
        }