diff mbox series

[PULL,12/28] test-util-filemonitor: Plug unlikely memory leak

Message ID 20200702110931.2953148-13-armbru@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,01/28] chardev/tcp: Fix error message double free error | expand

Commit Message

Markus Armbruster July 2, 2020, 11:09 a.m. UTC
test_file_monitor_events() leaks an Error object when
qemu_file_monitor_add_watch() fails, which seems unlikely.  Plug it.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200630090351.1247703-11-armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/test-util-filemonitor.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c
index 45009c69f4..8f0eff3d03 100644
--- a/tests/test-util-filemonitor.c
+++ b/tests/test-util-filemonitor.c
@@ -495,6 +495,7 @@  test_file_monitor_events(void)
             if (*op->watchid < 0) {
                 g_printerr("Unable to add watch %s",
                            error_get_pretty(local_err));
+                error_free(local_err);
                 goto cleanup;
             }
             if (debug) {