]> granicus.if.org Git - php/commitdiff
- pemalloc() might return NULL.
authorMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 20 Jul 2004 18:03:19 +0000 (18:03 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 20 Jul 2004 18:03:19 +0000 (18:03 +0000)
ext/standard/filters.c

index 773ee7c501d6e4dcdc8462302b17d55f74158c0b..41f2e7f96217ff8c4c557d579c75f1bfa24ba704 100644 (file)
@@ -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 {