]> git.proxmox.com Git - mirror_ovs.git/commit
ovsdb-tool: fix memory leak while running "db-is-standalone" command
authorDamijan Skvarc <damjan.skvarc@gmail.com>
Mon, 7 Oct 2019 08:30:07 +0000 (10:30 +0200)
committerBen Pfaff <blp@ovn.org>
Mon, 7 Oct 2019 18:13:07 +0000 (11:13 -0700)
commit36e282f5c97891ee36f5ba71b017e8ee665b01d5
treec0ac088b5b3fa40f897e2a835a849cca816c1856
parent7d6a859e15d4ba54650e0d50063d909541493fd7
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@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovsdb/ovsdb-tool.c