]> xenbits.xensource.com Git - qemu-upstream-unstable.git/commit
blockdev: Plug memory leak in drive_init()
authorMarkus Armbruster <armbru@redhat.com>
Wed, 28 May 2014 09:17:02 +0000 (11:17 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 5 Aug 2014 16:41:34 +0000 (11:41 -0500)
commit40a3fb54b29970a2c97dde39aa97b9201ad7a7cf
tree0e2f966868279db75bc3938b6e1891d2b03e6549
parent98646a11d0977b99bd05efbd6bf8330411ebba63
blockdev: Plug memory leak in drive_init()

bs_opts is leaked on all paths from its qdev_new() that don't got
through blockdev_init().  Add the missing QDECREF(), and zap bs_opts
after blockdev_init(), so the new QDECREF() does nothing when we go
through blockdev_init().

Leak introduced in commit f298d07.  Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 3cb0e25c4b417b7336816bd92de458f0770d49ff)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
blockdev.c