if (filter_type)
return filter_type;
- filter->event_filters = realloc(filter->event_filters,
- sizeof(*filter->event_filters) *
- (filter->filters + 1));
- if (!filter->event_filters)
- die("Could not allocate filter");
+ filter_type = realloc(filter->event_filters,
+ sizeof(*filter->event_filters) *
+ (filter->filters + 1));
+ if (!filter_type)
+ return NULL;
+
+ filter->event_filters = filter_type;
for (i = 0; i < filter->filters; i++) {
if (filter->event_filters[i].event_id > id)
}
filter_type = add_filter_type(filter, event->id);
+ if (filter_type == NULL) {
+ show_error(error_str, "failed to add a new filter: %s",
+ filter_str ? filter_str : "true");
+ return -1;
+ }
+
if (filter_type->filter)
free_arg(filter_type->filter);
filter_type->filter = arg;
arg->boolean.value = 0;
filter_type = add_filter_type(filter, event->id);
+ if (filter_type == NULL)
+ return -1;
+
filter_type->filter = arg;
free(str);