Semantic patch:
@@
expression e;
@@
- if (e) { free(e); }
+ free(e);
@@
expression e;
@@
- if (e != NULL) { free(e); }
+ free(e);
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I4d2d79a8beda4ca1ec7bacd5424c3c8e19d158f0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1698
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
norm_path = NULL;
}
end:
- if (tmp) {
- free(tmp);
- }
+ free(tmp);
return norm_path;
}
#else
}
}
- if (buf) {
- free(buf);
- }
+ free(buf);
return status;
}
BT_HIDDEN
void ctf_fs_metadata_fini(struct ctf_fs_metadata *metadata)
{
- if (metadata->text) {
- free(metadata->text);
- }
+ free(metadata->text);
if (metadata->trace_class) {
BT_TRACE_CLASS_PUT_REF_AND_RESET(metadata->trace_class);
ret = bin_info_lookup_function_name(bin, SO_INV_ADDR, &_func_name);
ok(ret == -1 && _func_name == NULL,
"bin_info_lookup_function_name - fail on invalid addr");
- if (_func_name) {
- free(_func_name);
- }
+ free(_func_name);
}
static