]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Fix error path logic in virDomainObjListLoadStatus
authorJohn Ferlan <jferlan@redhat.com>
Mon, 26 Mar 2018 23:14:30 +0000 (19:14 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 6 Apr 2018 18:14:37 +0000 (14:14 -0400)
commite0f7707cd54277ea9c1492e148c18fb4ca5d6aef
tree8380b84dbe23e191d5b1b3b6ef5032452176af8c
parent2689a922aa0d637e65f0296e05454918804fd2b0
conf: Fix error path logic in virDomainObjListLoadStatus

If the virHashAddEntry fails, then we need to "careful" about
how we free the @obj. When virDomainObjParseFile returns there
is one reference and the object is locked, so use virDomainObjEndAPI
when done.

Add a virObjectRef in the error path for the second virHashAddEntry
call since it doesn't call virObjectRef, but virHashRemoveEntry
will call virObjectUnref because virObjectFreeHashData is called
when the element is removed from the hash table as set up in
virDomainObjListNew.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/conf/virdomainobjlist.c