[ovs-git] [openvswitch/ovs] 36e282: ovsdb-tool: fix memory leak while running "db-is-s...
damijans
noreply at github.com
Mon Oct 7 18:21:35 UTC 2019
Branch: refs/heads/master
Home: https://github.com/openvswitch/ovs
Commit: 36e282f5c97891ee36f5ba71b017e8ee665b01d5
https://github.com/openvswitch/ovs/commit/36e282f5c97891ee36f5ba71b017e8ee665b01d5
Author: Damijan Skvarc <damjan.skvarc at gmail.com>
Date: 2019-10-07 (Mon, 07 Oct 2019)
Changed paths:
M ovsdb/ovsdb-tool.c
Log Message:
-----------
ovsdb-tool: fix memory leak while running "db-is-standalone" command
problem is reported by valgrind while running functional tests:
==21043== 160 (88 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 8
==21043== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21043== by 0x45EE2E: xmalloc (util.c:138)
==21043== by 0x40CB81: ovsdb_log_open (log.c:270)
==21043== by 0x406B4F: do_db_has_magic.isra.9 (ovsdb-tool.c:563)
==21043== by 0x438670: ovs_cmdl_run_command__ (command-line.c:223)
==21043== by 0x438720: ovs_cmdl_run_command (command-line.c:254)
==21043== by 0x405A4C: main (ovsdb-tool.c:79)
problem was in do_db_has_magic() which opens log file which is never closed.
Signed-off-by: Damijan Skvarc <damjan.skvarc at gmail.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Commit: 4cdc7b4db41c5dd06c5889683bc585c0b4899162
https://github.com/openvswitch/ovs/commit/4cdc7b4db41c5dd06c5889683bc585c0b4899162
Author: Damijan Skvarc <damjan.skvarc at gmail.com>
Date: 2019-10-07 (Mon, 07 Oct 2019)
Changed paths:
M ovsdb/ovsdb-tool.c
Log Message:
-----------
ovsdb-tool: fix memory leak while converting cluster into standalone database
memory leak is reported by valgrind while executing functional test
"ovsdb-tool convert-to-standalone"
==13842== 2,850 (280 direct, 2,570 indirect) bytes in 7 blocks are definitely lost in loss record 20 of 20
==13842== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13842== by 0x45EE2E: xmalloc (util.c:138)
==13842== by 0x43E386: json_create (json.c:1451)
==13842== by 0x43BDD2: json_object_create (json.c:254)
==13842== by 0x43DEE3: json_parser_push_object (json.c:1273)
==13842== by 0x43E167: json_parser_input (json.c:1371)
==13842== by 0x43D6EA: json_lex_input (json.c:991)
==13842== by 0x43DAC1: json_parser_feed (json.c:1149)
==13842== by 0x40D108: parse_body (log.c:411)
==13842== by 0x40D386: ovsdb_log_read (log.c:476)
==13842== by 0x406A0B: do_convert_to_standalone (ovsdb-tool.c:1571)
==13842== by 0x406A0B: do_cluster_standalone (ovsdb-tool.c:1606)
==13842== by 0x438670: ovs_cmdl_run_command__ (command-line.c:223)
==13842== by 0x438720: ovs_cmdl_run_command (command-line.c:254)
==13842== by 0x405A4C: main (ovsdb-tool.c:79)
The problem was in do_convert_to_standalone() function which while reading log file
allocate json object which was not deallocated at the end.
Signed-off-by: Damijan Skvarc <damjan.skvarc at gmail.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Compare: https://github.com/openvswitch/ovs/compare/7d6a859e15d4...4cdc7b4db41c
More information about the git
mailing list