Coverity reported the following:
CID
1401801 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)8.
negative_returns: fd is passed to a parameter that cannot be negative.
Reported-by: Coverity - Argument cannot be negative (NEGATIVE_RETURNS)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Ibcdcfd54f5f711923e5a31544c86e82da3ec6226
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2048
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
if (dwarf_info) {
dwarf_end(dwarf_info);
}
if (dwarf_info) {
dwarf_end(dwarf_info);
}
+
+ if (fd >= 0) {
+ close(fd);
+ }