提交 50bf3101 编写于 作者: J Jim Meyering

virStorageBackendFileSystemMount: prefer strdup over virAsprintf

* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount):
Use virAsprintf only when needed.  In this case, strdup works fine.
上级 5cff81b1
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册