提交 ab9c72ae 编写于 作者: P Peter Krempa

storage_backend_fs: Don't free a part of a structure on error

As the storage pool sources are stored in a list of structs, the pointer
returned by virStoragePoolSourceListNewSource() shouldn't be freed as it
points in the middle of a memory block. This combined with a regression
that takes the error path every time on caused a double-free abort on
the src struct in question.
上级 73f4b308
......@@ -218,10 +218,8 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTR
}
src->format = VIR_STORAGE_POOL_NETFS_NFS;
src = NULL;
ret = 0;
cleanup:
virStoragePoolSourceFree(src);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册