qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migration: free 'saddr' since be no longer used
@ 2023-11-15  3:27 Zongmin Zhou
  2023-11-15  9:49 ` Daniel P. Berrangé
  0 siblings, 1 reply; 13+ messages in thread
From: Zongmin Zhou @ 2023-11-15  3:27 UTC (permalink / raw)
  To: quintela, peterx, farosas; +Cc: leobras, qemu-devel, Zongmin Zhou

Since socket_parse() will allocate memory for 'saddr',
and its value will pass to 'addr' that allocated
by migrate_uri_parse(),so free 'saddr' to avoid memory leak.

Fixes: 72a8192e225c ("migration: convert migration 'uri' into 'MigrateAddress'")
Signed-off-by: Zongmin Zhou<zhouzongmin@kylinos.cn>
---
 migration/migration.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/migration/migration.c b/migration/migration.c
index 28a34c9068..30ed4bf6b6 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -493,6 +493,7 @@ bool migrate_uri_parse(const char *uri, MigrationChannel **channel,
         }
         addr->u.socket.type = saddr->type;
         addr->u.socket.u = saddr->u;
+        qapi_free_SocketAddress(saddr);
     } else if (strstart(uri, "file:", NULL)) {
         addr->transport = MIGRATION_ADDRESS_TYPE_FILE;
         addr->u.file.filename = g_strdup(uri + strlen("file:"));
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-11-30 10:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-15  3:27 [PATCH] migration: free 'saddr' since be no longer used Zongmin Zhou
2023-11-15  9:49 ` Daniel P. Berrangé
2023-11-15 16:44   ` Peter Xu
2023-11-16  6:34     ` [PATCH v2] " Zongmin Zhou
2023-11-16 14:19       ` Juan Quintela
2023-11-17  2:51         ` Zongmin Zhou
2023-11-17 13:56           ` Peter Xu
2023-11-20  3:14             ` [PATCH v3] " Zongmin Zhou
2023-11-20  9:08               ` Daniel P. Berrangé
2023-11-20 14:01               ` Peter Xu
2023-11-29  2:09                 ` Zongmin Zhou
2023-11-29 14:47                   ` Peter Xu
2023-11-30 10:20                     ` Het Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).