mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
virStorageBackendFileSystemMount: prefer strdup over virAsprintf
* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Use virAsprintf only when needed. In this case, strdup works fine.
This commit is contained in:
parent
5cff81b147
commit
50bf3101a3
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user