Fix: Possible memory leaks when creating filter IR root node
authorChristian Babeux <christian.babeux@efficios.com>
Tue, 23 Oct 2012 19:36:17 +0000 (15:36 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 25 Oct 2012 19:55:30 +0000 (15:55 -0400)
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/lib/lttng-ctl/filter/filter-visitor-generate-ir.c

index eec78fcae99ab68a866ce09d078811dfaf1a2d52..84122c90478890260591d65b9a7ad0e2a49ca954 100644 (file)
@@ -46,9 +46,11 @@ struct ir_op *make_op_root(struct ir_op *child, enum ir_side side)
        case IR_DATA_UNKNOWN:
        default:
                fprintf(stderr, "[error] Unknown root child data type\n");
        case IR_DATA_UNKNOWN:
        default:
                fprintf(stderr, "[error] Unknown root child data type\n");
+               free(op);
                return NULL;
        case IR_DATA_STRING:
                fprintf(stderr, "[error] String cannot be root data type\n");
                return NULL;
        case IR_DATA_STRING:
                fprintf(stderr, "[error] String cannot be root data type\n");
+               free(op);
                return NULL;
        case IR_DATA_NUMERIC:
        case IR_DATA_FIELD_REF:
                return NULL;
        case IR_DATA_NUMERIC:
        case IR_DATA_FIELD_REF:
This page took 0.037771 seconds and 4 git commands to generate.