com php-src: Fixed memory leaks: ext/standard/file.c
| From: | Dmitry Stogov | Date: | Tue, 25 Feb 2014 19:12:25 +0000 |
| Subject: | com php-src: Fixed memory leaks: ext/standard/file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77926@lists.php.net to get a copy of this message | ||
Commit: 1ac966d5249335c409e663689682894ac624d24b
Author: Dmitry Stogov <dmitry@zend.com> Tue, 25 Feb 2014 23:12:25 +0400
Parents: 4fd84823f66b117242eeeb35eff9a76a6b17b335
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1ac966d5249335c409e663689682894ac624d24b
Log:
Fixed memory leaks
Changed paths:
M ext/standard/file.c
Diff:
diff --git a/ext/standard/file.c b/ext/standard/file.c
index c4327fa..ffe9b00 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -764,7 +764,7 @@ PHP_FUNCTION(file)
do {
p++;
parse_eol:
- add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
+ add_index_stringl(return_value, i++, s, p-s, 1);
s = p;
} while ((p = memchr(p, eol_marker, (e-p))));
} else {
@@ -777,7 +777,7 @@ parse_eol:
s = ++p;
continue;
}
- add_index_stringl(return_value, i++, estrndup(s, p-s-windows_eol), p-s-windows_eol, 0);
+ add_index_stringl(return_value, i++, s, p-s-windows_eol, 1);
s = ++p;
} while ((p = memchr(p, eol_marker, (e-p))));
}