cvs: /php4/ext/standard var.c
| From: | Thies C. Arntzen | Date: | Mon, 18 Oct 1999 15:04:00 +0000 |
| Subject: | cvs: /php4/ext/standard var.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5549@lists.php.net to get a copy of this message | ||
thies Mon Oct 18 11:04:00 1999 EDT
Modified files:
/php4/ext/standard var.c
Log:
(PHP unserialize) - fixed mem-leak.
Index: php4/ext/standard/var.c
diff -u php4/ext/standard/var.c:1.29 php4/ext/standard/var.c:1.30
--- php4/ext/standard/var.c:1.29 Fri Sep 24 14:57:02 1999
+++ php4/ext/standard/var.c Mon Oct 18 11:03:29 1999
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.29 1999/09/24 18:57:02 andrey Exp $ */
+/* $Id: var.c,v 1.30 1999/10/18 15:03:29 thies Exp $ */
/* {{{ includes
@@ -419,6 +419,7 @@
(*p)++;
}
if (**p != ':' || *((*p) + 1) != '{') {
+ pval_destructor(*rval);
return 0;
}
for ((*p) += 2; **p && **p != '}' && i > 0; i--) {
@@ -426,11 +427,13 @@
pval *data = emalloc(sizeof(pval));
if (!php_var_unserialize(&key, p, max)) {
+ pval_destructor(*rval);
efree(key);
efree(data);
return 0;
}
if (!php_var_unserialize(&data, p, max)) {
+ pval_destructor(*rval);
pval_destructor(key);
efree(key);
efree(data);