Commit b23183a7 authored by William Tu's avatar William Tu Committed by Ben Pfaff

ovs-ofctl: Fix memory leak reported by valgrind.

Reported by 348: ovs-ofctl parse-flows (skb_priority)
Reason: return without freeing memory
Signed-off-by: default avatarWilliam Tu <u9012063@gmail.com>
Signed-off-by: default avatarDaniele Di Proietto <diproiettod@vmware.com>
Co-authored-by: default avatarDaniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: default avatarBen Pfaff <blp@ovn.org>
parent 362d9418
......@@ -955,6 +955,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++) {
......@@ -969,7 +970,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment