From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Juan Quintela" <quintela@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [Qemu-devel] [PATCH] migration: fix small leak
Date: Fri, 8 Mar 2019 17:07:31 +0100 [thread overview]
Message-ID: <20190308160731.23312-1-marcandre.lureau@redhat.com> (raw)
Spotted by ASAN, during make check.
Fixes: 9aca82ba3108d15529a2e0f5b0996cac309a7216 ("migration: Create
socket-address parameter")
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
migration/migration.h | 2 +-
migration/migration.c | 2 +-
migration/socket.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/migration/migration.h b/migration/migration.h
index 99e99e56bd..1b10b19a67 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -308,7 +308,7 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value);
void dirty_bitmap_mig_before_vm_start(void);
void init_dirty_bitmap_incoming_migration(void);
-void migrate_add_address(SocketAddress *address);
+void migrate_add_address(const SocketAddress *address);
int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque);
diff --git a/migration/migration.c b/migration/migration.c
index df6fd8e0e5..9cc2036796 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -335,7 +335,7 @@ void migration_incoming_enable_colo(void)
migration_colo_enabled = true;
}
-void migrate_add_address(SocketAddress *address)
+void migrate_add_address(const SocketAddress *address)
{
MigrationIncomingState *mis = migration_incoming_get_current();
SocketAddressList *addrs;
diff --git a/migration/socket.c b/migration/socket.c
index 239527fb1f..49bacf78fd 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -199,6 +199,7 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
return;
}
migrate_add_address(address);
+ qapi_free_SocketAddress(address);
}
}
--
2.21.0.4.g36eb1cb9cf
next reply other threads:[~2019-03-08 16:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 16:07 Marc-André Lureau [this message]
2019-03-11 2:57 ` [Qemu-devel] [PATCH] migration: fix small leak Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190308160731.23312-1-marcandre.lureau@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).