[lttng-dev] [PATCH lttng-tools] Fix: Possible memory leaks when creating filter IR root node

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Oct 23 15:57:27 EDT 2012


* Christian Babeux (christian.babeux at efficios.com) wrote:
> 
> Signed-off-by: Christian Babeux <christian.babeux at efficios.com>

Acked-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

> ---
>  src/lib/lttng-ctl/filter/filter-visitor-generate-ir.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/lib/lttng-ctl/filter/filter-visitor-generate-ir.c b/src/lib/lttng-ctl/filter/filter-visitor-generate-ir.c
> index eec78fc..84122c9 100644
> --- a/src/lib/lttng-ctl/filter/filter-visitor-generate-ir.c
> +++ b/src/lib/lttng-ctl/filter/filter-visitor-generate-ir.c
> @@ -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");
> +		free(op);
>  		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:
> -- 
> 1.7.12.2
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list