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 69fbeaefa9..867fe82b92 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 33b3c27e51..d3e7fe9d7a 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