- Fix #55301 (url scanner part) check if malloc succeded

This commit is contained in:
Pierre Joye 2011-07-28 10:52:45 +00:00
parent 618b480d91
commit 74de7dd66d
2 changed files with 11 additions and 4 deletions

View File

@ -57,9 +57,12 @@ static PHP_INI_MH(OnUpdateTags)
if (ctx->tags)
zend_hash_destroy(ctx->tags);
else
else {
ctx->tags = malloc(sizeof(HashTable));
if (!ctx->tags) {
return FAILURE;
}
}
zend_hash_init(ctx->tags, 0, NULL, NULL, 1);
for (key = php_strtok_r(tmp, ",", &lasts);

View File

@ -55,9 +55,13 @@ static PHP_INI_MH(OnUpdateTags)
if (ctx->tags)
zend_hash_destroy(ctx->tags);
else
else {
ctx->tags = malloc(sizeof(HashTable));
if (!ctx->tags) {
return FAILURE;
}
}
zend_hash_init(ctx->tags, 0, NULL, NULL, 1);
for (key = php_strtok_r(tmp, ",", &lasts);