[ovs-dev] [PATCH 06/16] ofproto-dpif-rid: Fix memory leak in recirc_id_pool_destroy().

Ben Pfaff blp at nicira.com
Fri Jun 6 05:02:00 UTC 2014


recirc_id_pool_create() allocates memory but recirc_id_pool_destroy() did
not destroy it.

Found by valgrind.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 ofproto/ofproto-dpif-rid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ofproto/ofproto-dpif-rid.c b/ofproto/ofproto-dpif-rid.c
index 9e7e9a3..b3d98eb 100644
--- a/ofproto/ofproto-dpif-rid.c
+++ b/ofproto/ofproto-dpif-rid.c
@@ -70,6 +70,7 @@ recirc_id_pool_destroy(struct recirc_id_pool *pool)
 {
     rid_pool_uninit(&pool->rids);
     ovs_mutex_destroy(&pool->lock);
+    free(pool);
 }
 
 uint32_t
-- 
1.9.1




More information about the dev mailing list