summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-05-26 16:25:14 -0700
committerBen Pfaff <blp@ovn.org>2017-06-01 16:20:20 -0700
commit88a74b2060e58c821b0f01cdc36df48ee36be6e5 (patch)
tree311a2879c092a5a01332234516f69cffa36a2ceb /lib
parentfedf8301957df0087a1bba963454486c665e28ec (diff)
downloadopenvswitch-88a74b2060e58c821b0f01cdc36df48ee36be6e5.tar.gz
ofp-parse: Fix memory leak on error path in parse_ofp_group_mod_file().
Found by Coverity. Reported-by: https://scan3.coverity.com/reports.htm#v16889/p10449/fileInstanceId=14762655&defectInstanceId=4305334&mergedDefectId=180394 Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ofp-parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 987b46397..2e4942262 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -1888,7 +1888,9 @@ parse_ofp_group_mod_file(const char *file_name,
fclose(stream);
}
- return xasprintf("%s:%d: %s", file_name, line_number, error);
+ char *ret = xasprintf("%s:%d: %s", file_name, line_number, error);
+ free(error);
+ return ret;
}
*usable_protocols &= usable;
*n_gms += 1;