]> xenbits.xensource.com Git - libvirt.git/commit
storage: avoid memory leak
authorEric Blake <eblake@redhat.com>
Thu, 2 Jun 2011 22:08:28 +0000 (16:08 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 3 Jun 2011 14:11:42 +0000 (08:11 -0600)
commit9892f7bca01d01a6b15ad7ff5c679893bf1fa022
treeb3a1551bb89f24aca2271a148642ff08e5ae502f
parentef21bedaf92f1d0399e3c20b9071086a255eeb47
storage: avoid memory leak

Coverity detected that options was being set by strdup but never
freed.  But why even bother with an options variable?  The options
parameter never changes!  Leak present since commit 44948f5b (0.7.0).

This function could probably be rewritten to take better advantage
of virCommand, but that is more invasive.

* src/storage/storage_backend_fs.c
(virStorageBackendFileSystemMount): Avoid wasted strdup, and
guarantee proper cleanup on all paths.
src/storage/storage_backend_fs.c