com php-src: fix leak in 5.6: ext/session/mod_files.c
| From: | Ferenc Kovacs | Date: | Tue, 02 Feb 2016 23:58:20 +0000 |
| Subject: | com php-src: fix leak in 5.6: ext/session/mod_files.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90924@lists.php.net to get a copy of this message | ||
Commit: 9a4bd51a93b3c74f88436cd4ad5aebf0eaa1dc52
Author: Anatol Belski <ab@php.net> Fri, 29 Jan 2016 13:56:11 +0100
Committer: Ferenc Kovacs <tyrael@php.net> Wed, 3 Feb 2016 00:58:20 +0100
Parents: e15b75671cf6ab67a0b6b33fc8798e2adefb39b5
Branches: PHP-5.6.18
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9a4bd51a93b3c74f88436cd4ad5aebf0eaa1dc52
Log:
fix leak in 5.6
Changed paths:
M ext/session/mod_files.c
Diff:
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 7e37381..06659e3 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -361,6 +361,18 @@ PS_READ_FUNC(files)
}
if (!PS(id)) {
+ if (data) {
+ if (data->lastkey) {
+ efree(data->lastkey);
+ data->lastkey = NULL;
+ }
+ if (data->basedir) {
+ efree(data->basedir);
+ data->basedir = NULL;
+ }
+ efree(data);
+ *mod_data = NULL;
+ }
return FAILURE;
}