From: Jim Meyering Date: Wed, 14 Apr 2010 08:03:03 +0000 (+0200) Subject: virStorageBackendFileSystemMount: prefer strdup over virAsprintf X-Git-Tag: v0.8.1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50bf3101a30fb1bd03913e7ae46807ce405286fd;p=thirdparty%2Flibvirt.git virStorageBackendFileSystemMount: prefer strdup over virAsprintf * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Use virAsprintf only when needed. In this case, strdup works fine. --- diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 0b81c6c0c2..c96c4f3eb9 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -376,7 +376,7 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) { if (pool->def->type == VIR_STORAGE_POOL_NETFS) { if (pool->def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS) { - if (virAsprintf(&options, "direct-io-mode=1") == -1) { + if ((options = strdup("direct-io-mode=1")) == NULL) { virReportOOMError(); return -1; }