]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "nwfilter: Move save of config until after successful assign"
authorJohn Ferlan <jferlan@redhat.com>
Sat, 15 Jul 2017 12:23:42 +0000 (08:23 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 17 Jul 2017 13:18:39 +0000 (09:18 -0400)
This reverts commit b3e71a8830b2683ee88fa10cb048eabb99a446c0.

As it turns out this ends up very badly as the @def could be Free'd
even though it's owned by @obj as a result of the AssignDef.

src/conf/virnwfilterobj.c

index 39e267292ff1b256d54891cbe7396d80299e6970..93072bec04add34e91183246c084561a6cd559b7 100644 (file)
@@ -524,14 +524,14 @@ virNWFilterObjListLoadConfig(virNWFilterObjListPtr nwfilters,
         goto error;
     }
 
-    if (!(obj = virNWFilterObjListAssignDef(nwfilters, def)))
-        goto error;
-
     /* We generated a UUID, make it permanent by saving the config to disk */
     if (!def->uuid_specified &&
         virNWFilterSaveConfig(configDir, def) < 0)
         goto error;
 
+    if (!(obj = virNWFilterObjListAssignDef(nwfilters, def)))
+        goto error;
+
     VIR_FREE(configFile);
     return obj;