diff options
author | Thies C. Arntzen <thies@php.net> | 1999-10-18 15:03:29 +0000 |
---|---|---|
committer | Thies C. Arntzen <thies@php.net> | 1999-10-18 15:03:29 +0000 |
commit | cf1134787aac10d7d65eeed0470e0886ef85d521 (patch) | |
tree | 88c295d2e49f4dceaaefc8dabf8d6669c802c8a8 | |
parent | 52a30fd21b10469413a3c2ffdbbccff294a350e7 (diff) | |
download | php-git-cf1134787aac10d7d65eeed0470e0886ef85d521.tar.gz |
(PHP unserialize) - fixed mem-leak.
-rw-r--r-- | ext/standard/var.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/var.c b/ext/standard/var.c index f5d61dc1f5..6f82505b2f 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -419,6 +419,7 @@ int php_var_unserialize(pval **rval, const char **p, const char *max) (*p)++; } if (**p != ':' || *((*p) + 1) != '{') { + pval_destructor(*rval); return 0; } for ((*p) += 2; **p && **p != '}' && i > 0; i--) { @@ -426,11 +427,13 @@ int php_var_unserialize(pval **rval, const char **p, const char *max) 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); |