From 4a614cd6b146f47b1fc976162366a201ad80c3fb Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 7 Mar 2007 00:52:40 +0000 Subject: [PATCH] malloc() -> pemalloc() --- ext/standard/browscap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 92311046037..1c5bd70ba46 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -55,7 +55,7 @@ static void convert_browscap_pattern(zval *pattern) php_strtolower(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern)); - t = (char *) malloc(Z_STRLEN_P(pattern)*2 + 3); + t = (char *) safe_pemalloc(Z_STRLEN_P(pattern), 2, 3, 1); t[0] = '^'; @@ -100,7 +100,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, int callback_type, vo zval *new_property; char *new_key; - new_property = (zval *) malloc(sizeof(zval)); + new_property = (zval *) pemalloc(sizeof(zval), 1); INIT_PZVAL(new_property); Z_STRVAL_P(new_property) = zend_strndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)); Z_STRLEN_P(new_property) = Z_STRLEN_P(arg2); @@ -118,14 +118,14 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, int callback_type, vo HashTable *section_properties; /*printf("'%s' (%d)\n",$1.value.str.val,$1.value.str.len+1);*/ - current_section = (zval *) malloc(sizeof(zval)); + current_section = (zval *) pemalloc(sizeof(zval), 1); INIT_PZVAL(current_section); - processed = (zval *) malloc(sizeof(zval)); + processed = (zval *) pemalloc(sizeof(zval), 1); INIT_PZVAL(processed); - unprocessed = (zval *) malloc(sizeof(zval)); + unprocessed = (zval *) pemalloc(sizeof(zval), 1); INIT_PZVAL(unprocessed); - section_properties = (HashTable *) malloc(sizeof(HashTable)); + section_properties = (HashTable *) pemalloc(sizeof(HashTable), 1); zend_hash_init(section_properties, 0, NULL, (dtor_func_t) browscap_entry_dtor, 1); current_section->value.ht = section_properties; current_section->type = IS_ARRAY;