Fix: lib: field-class.c: memory leak on error
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 9 Oct 2019 14:05:18 +0000 (10:05 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 9 Oct 2019 19:53:28 +0000 (15:53 -0400)
scan-build report:
  Potential leak of memory pointed to by 'var_with_sel_fc'
  File: src/lib/trace-ir/field-class.c Line: 1524

Reported-by: scan-build
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I6f52562c8549810ffb82c6ae4b34707ad6a32576
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2158
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/lib/trace-ir/field-class.c

index ce356b409f6c4008b76ac9bd071d3c49009c8c4f..02e4ab79913add729746b7204609914b3bcd809d 100644 (file)
@@ -1524,6 +1524,7 @@ struct bt_field_class *bt_field_class_variant_create(
 
 error:
        BT_OBJECT_PUT_REF_AND_RESET(var_fc);
+       BT_OBJECT_PUT_REF_AND_RESET(var_with_sel_fc);
 
 end:
        return (void *) var_fc;
This page took 0.024654 seconds and 4 git commands to generate.