tests: Pass in MigrateStart** into test_migrate_start()
authorPeter Xu <peterx@redhat.com>
Tue, 1 Mar 2022 08:39:25 +0000 (16:39 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 2 Mar 2022 18:20:45 +0000 (18:20 +0000)
commit3ff57401870481825c50d17afd393f64fa64a0b0
tree2c3627c66b55a5e374d4ce3c129c3ec822fb08f7
parente031149c78489413038e934eec9f54ac699cf322
tests: Pass in MigrateStart** into test_migrate_start()

test_migrate_start() will release the MigrateStart structure that passed
in, however that's not super clear to the caller because after the call
returned the pointer can still be referenced by the callers.  It can easily
be a source of use-after-free.

Let's pass in a double pointer of that, then we can safely clear the
pointer for the caller after the struct is released.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20220301083925.33483-26-peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  dgilbert: Fixup apply since I didn't take 24/25
tests/qtest/migration-test.c