cvs: /php4/ext/standard var.c

From: Date: Wed, 20 Oct 1999 14:34:47 +0000
Subject: cvs: /php4/ext/standard var.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-5599@lists.php.net to get a copy of this message
thies Wed Oct 20 10:34:47 1999 EDT Modified files: /php4/ext/standard var.c Log: (PHP var_dump, serialize) fixed mem_leak. Index: php4/ext/standard/var.c diff -u php4/ext/standard/var.c:1.31 php4/ext/standard/var.c:1.32 --- php4/ext/standard/var.c:1.31 Mon Oct 18 13:46:33 1999 +++ php4/ext/standard/var.c Wed Oct 20 10:34:16 1999 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c,v 1.31 1999/10/18 17:46:33 thies Exp $ */ +/* $Id: var.c,v 1.32 1999/10/20 14:34:16 thies Exp $ */ /* {{{ includes @@ -87,8 +87,11 @@ PHPWRITE(buf, strlen(buf)); } c++; - if (zend_hash_get_current_data(myht, (void **) (&data)) != SUCCESS || !data || (data == struc)) + if (zend_hash_get_current_data(myht, (void **) (&data)) != SUCCESS || !data || (data == struc)) { + if (i == HASH_KEY_IS_STRING) + efree(key); continue; + } switch (i) { case HASH_KEY_IS_LONG:{ pval *d = emalloc(sizeof(pval)); @@ -238,8 +241,9 @@ if ((i = zend_hash_get_current_key(myht, &key, &index)) == HASH_KEY_NON_EXISTANT) { break; } - if (zend_hash_get_current_data(myht, (void **) (&data)) != - SUCCESS || !data || ((*data) == (*struc))) { + if (zend_hash_get_current_data(myht, (void **) (&data)) != SUCCESS || !data || ((*data) == (*struc))) { + if (i == HASH_KEY_IS_STRING) + efree(key); continue; }

« previous php.version4 (#5599) next »