Reported by 348: ovs-ofctl parse-flows (skb_priority) Reason: return without freeing memory
Signed-off-by: William Tu <u9012...@gmail.com> Signed-off-by: Daniele Di Proietto <diproiet...@vmware.com> Co-authored-by: Daniele Di Proietto <diproiet...@vmware.com> --- lib/ofp-parse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index c346f10..aa0cad7 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -1039,6 +1039,7 @@ parse_ofp_flow_mod_file(const char *file_name, int command, error = parse_ofp_flow_mod_str(&(*fms)[*n_fms], ds_cstr(&s), command, &usable); if (error) { + char *err_msg; size_t i; for (i = 0; i < *n_fms; i++) { @@ -1053,7 +1054,9 @@ parse_ofp_flow_mod_file(const char *file_name, int command, fclose(stream); } - return xasprintf("%s:%d: %s", file_name, line_number, error); + err_msg = xasprintf("%s:%d: %s", file_name, line_number, error); + free(error); + return err_msg; } *usable_protocols &= usable; /* Each line can narrow the set. */ *n_fms += 1; -- 2.5.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev