Skip to content

Commit 499a97a

Browse files
author
Hartmut Holzgraefe
committed
changed to emalloc just to be safe
1 parent f7490c4 commit 499a97a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/yp/yp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,12 @@ static int php_foreach_cat (int instatus, char *inkey, int inkeylen, char *inval
296296
if (!err)
297297
{
298298
if (inkeylen) {
299-
char *key = malloc(inkeylen+1);
299+
char *key = emalloc(inkeylen+1);
300300
if(key) {
301301
strncpy(key, inkey, inkeylen);
302302
key[inkeylen] = '\0';
303303
add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1);
304-
free(key);
304+
efree(key);
305305
} else {
306306
php_error(E_WARNING, "Can't allocate %d bytes for key buffer in yp_cat()");
307307
}

0 commit comments

Comments
 (0)