]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: fix use after free in virChrdevOpen
authorJán Tomko <jtomko@redhat.com>
Wed, 22 May 2013 10:56:23 +0000 (12:56 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 18 Jun 2013 13:46:09 +0000 (15:46 +0200)
commit5313dd013f6bb02b70b960f8f121fd2fe113fe2f
treee0c210ea66df24ea369d8d798069d864926f0852
parentaeef630b5d70777d50bc7d3a5895ce272ba932c4
conf: fix use after free in virChrdevOpen

Don't free the stream on error if we've successfully added it
to the hash table, since it will be freed by virChrdevHashEntryFree
callback.

Preserve the error message before calling virStreamFree, since it
resets the error.

Introduced by 4716138, crashing since 6921892.

Reported by Sergey Fionov on libvir-list.
(cherry picked from commit a32b41746c4e1a44fb998a93da99c72f6586b359)
src/conf/virchrdev.c