mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
malloc() -> pemalloc()
This commit is contained in:
parent
f6343f45f2
commit
4a614cd6b1
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue