mirror of
https://github.com/openvswitch/ovs
synced 2025-09-04 16:25:17 +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:
@@ -2884,7 +2884,7 @@ dpif_netlink_ct_set_limits(struct dpif *dpif OVS_UNUSED,
|
|||||||
nl_msg_end_nested(request, opt_offset);
|
nl_msg_end_nested(request, opt_offset);
|
||||||
|
|
||||||
int err = nl_transact(NETLINK_GENERIC, request, NULL);
|
int err = nl_transact(NETLINK_GENERIC, request, NULL);
|
||||||
ofpbuf_uninit(request);
|
ofpbuf_delete(request);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2984,8 +2984,8 @@ dpif_netlink_ct_get_limits(struct dpif *dpif OVS_UNUSED,
|
|||||||
zone_limits_reply);
|
zone_limits_reply);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
ofpbuf_uninit(request);
|
ofpbuf_delete(request);
|
||||||
ofpbuf_uninit(reply);
|
ofpbuf_delete(reply);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3021,7 +3021,7 @@ dpif_netlink_ct_del_limits(struct dpif *dpif OVS_UNUSED,
|
|||||||
|
|
||||||
int err = nl_transact(NETLINK_GENERIC, request, NULL);
|
int err = nl_transact(NETLINK_GENERIC, request, NULL);
|
||||||
|
|
||||||
ofpbuf_uninit(request);
|
ofpbuf_delete(request);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user