From a5d3c2972e5cd4ed2c2e2649ae5e68204c33b263 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 11 Aug 2011 06:38:42 +0000 Subject: [PATCH] Fixed possible memory leak --- sapi/cgi/cgi_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index f2e4affdfa..d6d8bebfe0 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -761,7 +761,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; @@ -809,6 +809,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); } -- 2.40.0