From: Ben Pfaff Date: Tue, 20 Aug 2013 18:27:32 +0000 (-0700) Subject: ofproto-dpif-sflow: Fix memory leak. X-Git-Tag: sliver-openvswitch-2.0.90-1~20^2~34 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0891637f67671c0654b9ff6b4c25a654375d24e2;p=sliver-openvswitch.git 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 Acked-by: Ethan Jackson --- diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index b387b945a..44ad92733 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -280,6 +280,7 @@ dpif_sflow_clear__(struct dpif_sflow *ds) OVS_REQUIRES(mutex) { if (ds->sflow_agent) { sfl_agent_release(ds->sflow_agent); + free(ds->sflow_agent); ds->sflow_agent = NULL; } collectors_destroy(ds->collectors);