Skip to content

Commit

Permalink
ofp-port: Free memory on error in ofp_print_ofpst_port_reply
Browse files Browse the repository at this point in the history
Counters in ops->custom_stats may already be valid at this error point.
This patch frees the leaked memory.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10322
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
yifsun authored and blp committed Oct 23, 2018
1 parent bafb398 commit e9c363e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/ofp-port.c
Expand Up @@ -1679,6 +1679,7 @@ ofputil_pull_ofp14_port_stats(struct ofputil_port_stats *ops,

error = ofpprop_pull(&properties, &payload, &type);
if (error) {
netdev_free_custom_stats_counters(&ops->custom_stats);
return error;
}
switch (type) {
Expand Down

0 comments on commit e9c363e

Please sign in to comment.