Fix: Possible dereference of null pointers
[lttng-tools.git] / src / lib / lttng-ctl / filter / filter-visitor-set-parent.c
index 91c89dccb81b633463a0169d18af0d187530b25d..458688da44a13b4d924be20162b7d15e46f575eb 100644 (file)
@@ -36,6 +36,11 @@ int update_child(struct filter_node *parent,
                struct filter_node *old_child,
                struct filter_node *new_child)
 {
+       if (!parent) {
+               fprintf(stderr, "[error] %s: NULL parent\n", __func__);
+               return -EINVAL;
+       }
+
        switch (parent->type) {
        case NODE_UNKNOWN:
        default:
This page took 0.026661 seconds and 4 git commands to generate.