migration: simplify exec migration functionspull-qapi-2024-03-04
commit018d5fb1f91c7f316b4b8501a78e7219bb9fb614
authorSteve Sistare <steven.sistare@oracle.com>
Tue, 27 Feb 2024 15:33:21 +0000 (27 16:33 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 4 Mar 2024 06:12:40 +0000 (4 07:12 +0100)
tree86d34753eb63543295d26afcfc1a58844e85b520
parent8a08a366c5e05ce9417d4bcc364e76720a16b41f
migration: simplify exec migration functions

Simplify the exec migration code by using list utility functions.

As a side effect, this also fixes a minor memory leak.  On function return,
"g_auto(GStrv) argv" frees argv and each element, which is wrong, because
the function does not own the individual elements.  To compensate, the code
uses g_steal_pointer which NULLs argv and prevents the destructor from
running, but argv is leaked.

Fixes: cbab4face57b ("migration: convert exec backend ...")
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20240227153321.467343-4-armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
migration/exec.c