Our *Free functions usually do not take a double pointer and the caller
has to make sure it doesn't use the stale pointer after the *Free
function returns.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_migration_params.c | 10 +++++-----
src/qemu/qemu_migration_params.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 519bd767c1..bf6c0d0826 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12781,7 +12781,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
flags, dname, bandwidth, true);
cleanup:
VIR_FREE(compression);
- qemuMigrationParamsFree(&migParams);
+ qemuMigrationParamsFree(migParams);
VIR_FREE(migrate_disks);
return ret;
}
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 36a9fd3509..784b1b9254 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -50,13 +50,13 @@ qemuMigrationParamsClear(qemuMonitorMigrationParamsPtr migParams)
void
-qemuMigrationParamsFree(qemuMonitorMigrationParamsPtr *migParams)
+qemuMigrationParamsFree(qemuMonitorMigrationParamsPtr migParams)
{
- if (!*migParams)
+ if (!migParams)
return;
- qemuMigrationParamsClear(*migParams);
- VIR_FREE(*migParams);
+ qemuMigrationParamsClear(migParams);
+ VIR_FREE(migParams);
}
@@ -101,7 +101,7 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params,
return migParams;
error:
- qemuMigrationParamsFree(&migParams);
+ qemuMigrationParamsFree(migParams);
return NULL;
}
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index 0a68bc0e39..1f28d8d606 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -37,7 +37,7 @@ void
qemuMigrationParamsClear(qemuMonitorMigrationParamsPtr migParams);
void
-qemuMigrationParamsFree(qemuMonitorMigrationParamsPtr *migParams);
+qemuMigrationParamsFree(qemuMonitorMigrationParamsPtr migParams);
int
qemuMigrationParamsSet(virQEMUDriverPtr driver,
--
2.17.0