ofproto-dpif-sflow: Fix memory leak.
authorBen Pfaff <blp@nicira.com>
Tue, 20 Aug 2013 18:27:32 +0000 (11:27 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 20 Aug 2013 18:27:32 +0000 (11:27 -0700)
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>
ofproto/ofproto-dpif-sflow.c

index b387b94..44ad927 100644 (file)
@@ -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);