*/
LttvFilter*
lttv_filter_clone(const LttvFilter* filter) {
-
+
+ if(!filter) return NULL;
+
LttvFilter* newfilter = g_new(LttvFilter,1);
strcpy(newfilter->expression,filter->expression);
void
lttv_filter_destroy(LttvFilter* filter) {
- g_free(filter->expression);
- lttv_filter_tree_destroy(filter->head);
+ if(!filter) return;
+
+ if(filter->expression)
+ g_free(filter->expression);
+ if(filter->head)
+ lttv_filter_tree_destroy(filter->head);
g_free(filter);
}
/* Copy the previous tab's filter */
/* We can clone the filter, as we copy the trace set also */
/* The filter must always be in sync with the trace set */
- if(copy_tab->filter != NULL)
- tab->filter = lttv_filter_clone(copy_tab->filter);
- else
- tab->filter = NULL;
+ tab->filter = lttv_filter_clone(copy_tab->filter);
} else {
tab->traceset_info->traceset = lttv_traceset_new();