]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf,util,qemu: Use VIR_STEAL_PTR for authdef processing
authorJohn Ferlan <jferlan@redhat.com>
Thu, 7 Feb 2019 12:44:45 +0000 (07:44 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 12 Feb 2019 13:51:23 +0000 (08:51 -0500)
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c
src/conf/storage_conf.c
src/qemu/qemu_parse_command.c
src/util/virstoragefile.c

index 6772c327ed66ac1fa296d12518b8d5e69c1d2ea8..a33f18c9570378abe9583165e336be0721cd2422 100644 (file)
@@ -7632,8 +7632,7 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode,
                                authdef->secrettype);
                 goto cleanup;
             }
-            iscsisrc->src->auth = authdef;
-            authdef = NULL;
+            VIR_STEAL_PTR(iscsisrc->src->auth, authdef);
         }
         cur = cur->next;
     }
index 1ee31ca6768a491821895b2c321f7b1d229485d1..fbd62e1305d33766ceb607a1b9db5256dd5b9232 100644 (file)
@@ -584,8 +584,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt,
             goto cleanup;
         }
 
-        source->auth = authdef;
-        authdef = NULL;
+        VIR_STEAL_PTR(source->auth, authdef);
     }
 
     /* Option protocol version string (NFSvN) */
index c4650f01e0b824c6aba2f7f6f87d6c7e735ac557..679d49d442008d220a6640c780bd8ef095773a3d 100644 (file)
@@ -133,8 +133,7 @@ qemuParseDriveURIString(virDomainDiskDefPtr def, virURIPtr uri,
             if (VIR_STRDUP(authdef->secrettype, secrettype) < 0)
                 goto error;
         }
-        def->src->auth = authdef;
-        authdef = NULL;
+        VIR_STEAL_PTR(def->src->auth, authdef);
 
         /* Cannot formulate a secretType (eg, usage or uuid) given
          * what is provided.
index 8319ba9c8ca1836fcec7e4b6b6dcd54d3071720a..98f9bc803fb6a7e24ae267f0f9112337920968fc 100644 (file)
@@ -2895,9 +2895,8 @@ virStorageSourceParseRBDColonString(const char *rbdstr,
             if (VIR_STRDUP(authdef->secrettype,
                            virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_CEPH)) < 0)
                 goto error;
-            src->auth = authdef;
+            VIR_STEAL_PTR(src->auth, authdef);
             src->authInherited = true;
-            authdef = NULL;
 
             /* Cannot formulate a secretType (eg, usage or uuid) given
              * what is provided.