[ovs-dev] [PATCH] json: Fix leaked nodes in json_hash_object()

Thomas Graf tgraf at noironetworks.com
Tue Aug 26 10:23:03 UTC 2014


nodes is allocated through shash_sort() but never freed.

Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
---
 lib/json.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/json.c b/lib/json.c
index 167c40c..9c819d7 100644
--- a/lib/json.c
+++ b/lib/json.c
@@ -461,6 +461,7 @@ json_hash_object(const struct shash *object, size_t basis)
         basis = hash_string(node->name, basis);
         basis = json_hash(node->data, basis);
     }
+    free(nodes);
     return basis;
 }
 
-- 
1.9.3




More information about the dev mailing list