diff options
author | Moriyoshi Koizumi <moriyoshi@php.net> | 2004-07-20 18:03:19 +0000 |
---|---|---|
committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2004-07-20 18:03:19 +0000 |
commit | 3e026f08ae3fa11b398b01a43871c3cb1c8b4f54 (patch) | |
tree | c6e5990356d50aa2926721f753a2e589cc9f2da3 | |
parent | 180306cf8854595aa5c4dba0b8bd5d11d4a84aca (diff) | |
download | php-git-3e026f08ae3fa11b398b01a43871c3cb1c8b4f54.tar.gz |
- pemalloc() might return NULL.
-rw-r--r-- | ext/standard/filters.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 773ee7c501..41f2e7f962 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -176,7 +176,9 @@ typedef struct _php_strip_tags_filter { static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, int allowed_tags_len, int persistent) { if (allowed_tags != NULL) { - inst->allowed_tags = pemalloc(allowed_tags_len, persistent); + if (NULL != (inst->allowed_tags = pemalloc(allowed_tags_len, persistent))) { + return FAILURE; + } memcpy((char *)inst->allowed_tags, allowed_tags, allowed_tags_len); inst->allowed_tags_len = allowed_tags_len; } else { |