json: Fix leaked nodes in json_hash_object()
authorThomas Graf <tgraf@noironetworks.com>
Tue, 26 Aug 2014 10:23:03 +0000 (12:23 +0200)
committerBen Pfaff <blp@nicira.com>
Tue, 26 Aug 2014 16:13:38 +0000 (09:13 -0700)
nodes is allocated through shash_sort() but never freed.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/json.c

index 167c40c..9c819d7 100644 (file)
@@ -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;
 }