2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 13:58:14 +00:00

ofproto-dpif-sflow: Fix memory leak.

dpif_sflow_set_options() uses xcalloc() to allocate space for the SFLAgent
structure, but nothing ever freed it.  This fixes the problem.

Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ben Pfaff
2013-08-20 11:27:32 -07:00
parent 56450a416c
commit 0891637f67

View File

@@ -280,6 +280,7 @@ dpif_sflow_clear__(struct dpif_sflow *ds) OVS_REQUIRES(mutex)
{ {
if (ds->sflow_agent) { if (ds->sflow_agent) {
sfl_agent_release(ds->sflow_agent); sfl_agent_release(ds->sflow_agent);
free(ds->sflow_agent);
ds->sflow_agent = NULL; ds->sflow_agent = NULL;
} }
collectors_destroy(ds->collectors); collectors_destroy(ds->collectors);