cvs: php-src(PHP_5_2) /ext/standard array.c
| From: | Ilia Alshanetsky | Date: | Sat, 22 Sep 2007 15:32:11 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-46281@lists.php.net to get a copy of this message | ||
iliaa Sat Sep 22 15:32:11 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard array.c
Log:
Fixed memory leak inside array_diff() (coverity issues #401,#402)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.35&r2=1.308.2.21.2.36&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.35 php-src/ext/standard/array.c:1.308.2.21.2.36
--- php-src/ext/standard/array.c:1.308.2.21.2.35 Fri Sep 21 13:51:49 2007
+++ php-src/ext/standard/array.c Sat Sep 22 15:32:11 2007
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.308.2.21.2.35 2007/09/21 13:51:49 tony2001 Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.36 2007/09/22 15:32:11 iliaa Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -3634,6 +3634,8 @@
hash = HASH_OF(*args[i]);
list = (Bucket **) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket *),
hash->persistent);
if (!list) {
+ efree(ptrs);
+ efree(lists);
RETURN_FALSE;
}
lists[i] = list;