]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage_backend_fs: Don't free a part of a structure on error
authorPeter Krempa <pkrempa@redhat.com>
Mon, 9 Jul 2012 12:10:05 +0000 (14:10 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Jul 2012 14:25:15 +0000 (16:25 +0200)
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.

src/storage/storage_backend_fs.c

index c736496ef37eb4760ba6a906dc11cb547d0ca1f3..5e3da14963e87fa840e1a1418e6cabb17ed42227 100644 (file)
@@ -218,10 +218,8 @@ virStorageBackendFileSystemNetFindPoolSourcesFunc(virStoragePoolObjPtr pool ATTR
     }
     src->format = VIR_STORAGE_POOL_NETFS_NFS;
 
-    src = NULL;
     ret = 0;
 cleanup:
-    virStoragePoolSourceFree(src);
     return ret;
 }