2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

dpif-netlink: Free leaked ofpbuf by using ofpbuf_delete

Found by valgrind.

256 bytes in 4 blocks are definitely lost in loss record 319 of 348
    by 0x52E204: xmalloc (util.c:123)
    by 0x4F6172: ofpbuf_new (ofpbuf.c:151)
    by 0x53DEF2: dpif_netlink_ct_get_limits (dpif-netlink.c:2951)
    by 0x587881: dpctl_ct_get_limits (dpctl.c:1904)
    by 0x58566F: dpctl_unixctl_handler (dpctl.c:2589)
    by 0x52D660: process_command (unixctl.c:308)
    by 0x52D660: run_connection (unixctl.c:342)
    by 0x52D660: unixctl_server_run (unixctl.c:393)
    by 0x407366: main (ovs-vswitchd.c:126)

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Yifeng Sun
2019-03-05 15:27:01 -08:00
committed by Ben Pfaff
parent f1301a259a
commit c225ce2202

View File

@@ -2884,7 +2884,7 @@ dpif_netlink_ct_set_limits(struct dpif *dpif OVS_UNUSED,
nl_msg_end_nested(request, opt_offset);
int err = nl_transact(NETLINK_GENERIC, request, NULL);
ofpbuf_uninit(request);
ofpbuf_delete(request);
return err;
}
@@ -2984,8 +2984,8 @@ dpif_netlink_ct_get_limits(struct dpif *dpif OVS_UNUSED,
zone_limits_reply);
out:
ofpbuf_uninit(request);
ofpbuf_uninit(reply);
ofpbuf_delete(request);
ofpbuf_delete(reply);
return err;
}
@@ -3021,7 +3021,7 @@ dpif_netlink_ct_del_limits(struct dpif *dpif OVS_UNUSED,
int err = nl_transact(NETLINK_GENERIC, request, NULL);
ofpbuf_uninit(request);
ofpbuf_delete(request);
return err;
}