Fix: filter linking can dereference NULL pointer on alloc failure
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Nov 2012 17:28:49 +0000 (12:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Nov 2012 18:57:25 +0000 (13:57 -0500)
Reported-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-filter.c

index 62a745f197c4ddc377a57bcd4eb7404bab21a614..11e7e376a03006bec8fb2af8b86f95f16d53874a 100644 (file)
@@ -254,7 +254,7 @@ int _lttng_filter_event_link_bytecode(struct lttng_event *event,
        runtime = zmalloc(runtime_alloc_len);
        if (!runtime) {
                ret = -ENOMEM;
-               goto link_error;
+               goto alloc_error;
        }
        runtime->p.bc = filter_bytecode;
        runtime->len = filter_bytecode->bc.reloc_offset;
@@ -298,6 +298,7 @@ link_error:
        runtime->p.filter = lttng_filter_false;
        runtime->p.link_failed = 1;
        cds_list_add_rcu(&runtime->p.node, insert_loc);
+alloc_error:
        dbg_printf("Linking failed.\n");
        return ret;
 }
This page took 0.025786 seconds and 4 git commands to generate.