Message ID | 1539897049-5070-1-git-send-email-pkusunyifeng@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] ofp-port: Free memory on error in ofp_print_ofpst_port_reply | expand |
On Thu, Oct 18, 2018 at 02:10:47PM -0700, Yifeng Sun wrote: > 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> Thanks, applied and backported.
diff --git a/lib/ofp-port.c b/lib/ofp-port.c index 3d1ada9ceb99..15dac4f0ac2e 100644 --- a/lib/ofp-port.c +++ b/lib/ofp-port.c @@ -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) {
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> --- lib/ofp-port.c | 1 + 1 file changed, 1 insertion(+)