diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 327fab313432585e0dfdd34a5d949701c045aeea..09dc32b3772f4c591ce839d04ecfc8214f918d64 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -2588,10 +2588,8 @@ virNWFilterLoadAllConfigs(virConnectPtr conn, if (!virFileHasSuffix(entry->d_name, ".xml")) continue; - if (!(path = virFileBuildPath(configDir, entry->d_name, NULL))) { - virReportOOMError(); + if (!(path = virFileBuildPath(configDir, entry->d_name, NULL))) continue; - } nwfilter = virNWFilterObjLoad(conn, nwfilters, entry->d_name, path); if (nwfilter) @@ -2627,7 +2625,6 @@ virNWFilterObjSaveDef(virNWFilterDriverStatePtr driver, if (!(nwfilter->configFile = virFileBuildPath(driver->configDir, def->name, ".xml"))) { - virReportOOMError(); return -1; } } diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 5a069f54042e2ba646e1d41edcf35d1884575c7c..116898d85497092c42f4cabb1d73ea190f90c1d7 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1483,14 +1483,11 @@ virStoragePoolLoadAllConfigs(virStoragePoolObjListPtr pools, if (!virFileHasSuffix(entry->d_name, ".xml")) continue; - if (!(path = virFileBuildPath(configDir, entry->d_name, NULL))) { - virReportOOMError(); + if (!(path = virFileBuildPath(configDir, entry->d_name, NULL))) continue; - } if (!(autostartLink = virFileBuildPath(autostartDir, entry->d_name, NULL))) { - virReportOOMError(); VIR_FREE(path); continue; } @@ -1529,13 +1526,11 @@ virStoragePoolObjSaveDef(virStorageDriverStatePtr driver, if (!(pool->configFile = virFileBuildPath(driver->configDir, def->name, ".xml"))) { - virReportOOMError(); return -1; } if (!(pool->autostartLink = virFileBuildPath(driver->autostartDir, def->name, ".xml"))) { - virReportOOMError(); VIR_FREE(pool->configFile); return -1; } diff --git a/src/util/util.c b/src/util/util.c index de4e3b33f7dd138ac6bae294a0af1a3df51a9667..1bb032824be93950d8f2a34a77ef380bc4ddf415 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -1829,10 +1829,12 @@ virFileBuildPath(const char *dir, const char *name, const char *ext) if (ext == NULL) { if (virAsprintf(&path, "%s/%s", dir, name) < 0) { + virReportOOMError(); return NULL; } } else { if (virAsprintf(&path, "%s/%s%s", dir, name, ext) < 0) { + virReportOOMError(); return NULL; } } diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c index d809c45489a95d9c3ea5e7b99170093477a8b94a..9dde72cc22ada67dd4318957a4cb41a91728b069 100644 --- a/src/xen/xen_inotify.c +++ b/src/xen/xen_inotify.c @@ -415,7 +415,6 @@ xenInotifyOpen(virConnectPtr conn, /* Build the full file path */ if (!(path = virFileBuildPath(priv->configDir, ent->d_name, NULL))) { - virReportOOMError(); closedir(dh); return -1; } diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index db47a0206f61e6fe181cbfc2b35398e7590f311a..f9f52b5823f0ddaf4fe7b58e86ba2f9fdc617c4b 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -388,7 +388,6 @@ int xenXMConfigCacheRefresh (virConnectPtr conn) { /* Build the full file path */ if (!(path = virFileBuildPath(priv->configDir, ent->d_name, NULL))) { - virReportOOMError(); closedir(dh); return -1; } @@ -1134,10 +1133,8 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) entry = NULL; } - if (!(filename = virFileBuildPath(priv->configDir, def->name, NULL))) { - virReportOOMError(); + if (!(filename = virFileBuildPath(priv->configDir, def->name, NULL))) goto error; - } if (xenXMConfigSaveFile(conn, filename, def) < 0) goto error;