Skip to content

Commit

Permalink
ofp-port: Don't leak on error in ofputil_pull_ofp14_port_stats().
Browse files Browse the repository at this point in the history
With this change, we can remove a case of free done in the error code
path.

Signed-off-by: Justin Pettit <[email protected]>
Reviewed-by: Yifeng Sun <[email protected]>
  • Loading branch information
justinpettit committed Sep 14, 2018
1 parent cd2c1d3 commit 9539528
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions lib/ofp-port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,7 @@ ofputil_pull_ofp14_port_stats(struct ofputil_port_stats *ops,
}

if (error) {
netdev_free_custom_stats_counters(&ops->custom_stats);
return error;
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/ofp-print.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ ofp_print_ofpst_port_reply(struct ds *string, const struct ofp_header *oh,

retval = ofputil_decode_port_stats(&ps, &b);
if (retval) {
netdev_free_custom_stats_counters(&ps.custom_stats);
return retval != EOF ? retval : 0;
}
ofputil_format_port_stats(string, &ps, port_map);
Expand Down

0 comments on commit 9539528

Please sign in to comment.