]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Make qemuMigrationParamsFree follow common pattern
authorJiri Denemark <jdenemar@redhat.com>
Wed, 21 Feb 2018 14:56:18 +0000 (15:56 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 17 Apr 2018 08:46:23 +0000 (10:46 +0200)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c
src/qemu/qemu_migration_params.c
src/qemu/qemu_migration_params.h

index 45fe8dae5f741e3d8364b682f7130fe40791d090..f173231a22a35de34216989555399ff9fe2071b2 100644 (file)
@@ -12759,7 +12759,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
                                   flags, dname, bandwidth, true);
  cleanup:
     VIR_FREE(compression);
-    qemuMigrationParamsFree(&migParams);
+    qemuMigrationParamsFree(migParams);
     VIR_FREE(migrate_disks);
     return ret;
 }
index 36a9fd350914ba7db200886983afffe72533785b..784b1b92540bcd3658ba512d74895a0481f7787d 100644 (file)
@@ -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;
 }
 
index 0a68bc0e39644784a1c2b4d746d2d45856eee9ce..1f28d8d6061eab1ee01dc37163d20bc51c35d1ef 100644 (file)
@@ -37,7 +37,7 @@ void
 qemuMigrationParamsClear(qemuMonitorMigrationParamsPtr migParams);
 
 void
-qemuMigrationParamsFree(qemuMonitorMigrationParamsPtr *migParams);
+qemuMigrationParamsFree(qemuMonitorMigrationParamsPtr migParams);
 
 int
 qemuMigrationParamsSet(virQEMUDriverPtr driver,