]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virStorageBackendFileSystemMount: prefer strdup over virAsprintf
authorJim Meyering <meyering@redhat.com>
Wed, 14 Apr 2010 08:03:03 +0000 (10:03 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 14 Apr 2010 15:17:54 +0000 (17:17 +0200)
* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount):
Use virAsprintf only when needed.  In this case, strdup works fine.

src/storage/storage_backend_fs.c

index 0b81c6c0c24cfdcf20260cf22dc3f490630c48c6..c96c4f3eb9c6d832df4415083952fdf038c042f3 100644 (file)
@@ -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;
             }