From: John Ferlan Date: Sat, 15 Jul 2017 12:23:42 +0000 (-0400) Subject: Revert "nwfilter: Move save of config until after successful assign" X-Git-Tag: v3.6.0-rc1~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dff020c91d7a4ac8fb4bbe79511ed990fc616a3c;p=thirdparty%2Flibvirt.git Revert "nwfilter: Move save of config until after successful assign" 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. --- diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index 39e267292f..93072bec04 100644 --- a/src/conf/virnwfilterobj.c +++ b/src/conf/virnwfilterobj.c @@ -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;