summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYifeng Sun <pkusunyifeng@gmail.com>2018-04-03 10:12:58 -0700
committerBen Pfaff <blp@ovn.org>2018-04-04 14:02:51 -0700
commitb339ef592a2dc7acb945cd18f89169194ad23761 (patch)
tree0857b05d9f8704f464c651370cef47f317763ff4 /lib
parent8f0e86f84fbc200f67094e6139c0be01e521a018 (diff)
downloadopenvswitch-b339ef592a2dc7acb945cd18f89169194ad23761.tar.gz
ovsdb-idl: properly destroy ovsdb_idl.server
This patch fixes the memory leak reported by valgrind in testing "learning action - TCPv6 port learning" 150 (40 direct, 110 indirect) bytes in 1 blocks are definitely lost in loss record 329 of 363 at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x51D0D4: xmalloc (util.c:120) by 0x572E17: json_create (json.c:1442) by 0x572E17: json_array_create (json.c:217) by 0x572E17: json_array_create_2 (json.c:238) by 0x4F69EA: ovsdb_idl_db_init (ovsdb-idl.c:424) by 0x4F6A58: ovsdb_idl_create (ovsdb-idl.c:454) by 0x40FAC7: bridge_init (bridge.c:396) by 0x406F93: main (ovs-vswitchd.c:106) 3,727 (40 direct, 3,687 indirect) bytes in 1 blocks are definitely lost in loss record 358 of 363 at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x51D0D4: xmalloc (util.c:120) by 0x572EBA: json_create (json.c:1442) by 0x572EBA: json_object_create (json.c:254) by 0x573254: json_parser_push_object (json.c:1264) by 0x573254: json_parse_value.isra.12 (json.c:1293) by 0x57339F: json_parser_input (json.c:1398) by 0x5742C1: json_lex_input (json.c:982) by 0x5748EB: json_parser_feed (json.c:1140) by 0x57597A: jsonrpc_recv.part.7 (jsonrpc.c:332) by 0x5768A7: jsonrpc_recv (jsonrpc.c:1140) by 0x5768A7: jsonrpc_session_recv (jsonrpc.c:1113) by 0x4F4E5C: ovsdb_idl_run (ovsdb-idl.c:818) by 0x4100F9: bridge_run (bridge.c:2949) by 0x406FB4: main (ovs-vswitchd.c:121) Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ovsdb-idl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 11794a869..9b99375da 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -516,6 +516,7 @@ ovsdb_idl_destroy(struct ovsdb_idl *idl)
ovsdb_idl_clear(idl);
jsonrpc_session_close(idl->session);
+ ovsdb_idl_db_destroy(&idl->server);
ovsdb_idl_db_destroy(&idl->data);
json_destroy(idl->request_id);
free(idl);