]> xenbits.xensource.com Git - 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>
Thu, 23 May 2013 15:55:34 +0000 (17:55 +0200)
commita32b41746c4e1a44fb998a93da99c72f6586b359
tree3ddd634d1dff5f1597d1250f294f57e60f2c4ed2
parenta551e9e1fc0d3ab16545197fa70c0cc756881d4a
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.
src/conf/virchrdev.c