]> granicus.if.org Git - php/commitdiff
changed to emalloc just to be safe
authorHartmut Holzgraefe <hholzgra@php.net>
Wed, 26 Feb 2003 16:06:07 +0000 (16:06 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Wed, 26 Feb 2003 16:06:07 +0000 (16:06 +0000)
ext/yp/yp.c

index 8706ccffb23e32e1924f438cd1873be1da713fa2..cca06b17cf7d25649bc18642c31a3095b0b33c26 100644 (file)
@@ -296,12 +296,12 @@ static int php_foreach_cat (int instatus, char *inkey, int inkeylen, char *inval
        if (!err)
        {
                if (inkeylen) {
-                       char *key = malloc(inkeylen+1);
+                       char *key = emalloc(inkeylen+1);
                        if(key) {
                                strncpy(key, inkey, inkeylen);
                                key[inkeylen] = '\0';
                                add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1);
-                               free(key);
+                               efree(key);
                        } else {
                                php_error(E_WARNING, "Can't allocate %d bytes for key buffer in yp_cat()");
                        }