Browse Source

(PHP unserialize) - fixed mem-leak.

experimetnal/RETURN_REF_PATCH
Thies C. Arntzen 27 years ago
parent
commit
cf1134787a
  1. 3
      ext/standard/var.c

3
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);

Loading…
Cancel
Save