]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: Minor cleanup to virDomainSnapshotAssignDef
authorEric Blake <eblake@redhat.com>
Fri, 22 Mar 2019 06:05:06 +0000 (01:05 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 22 Mar 2019 06:15:20 +0000 (01:15 -0500)
commit0baf6945ed3b548a97be81402ffb1439cfc5c4da
tree16a6c29239c3cec4f66bcd29dd194a789ae82e17
parent967eef2b95da5f17e27345ac4352241e6f207793
snapshot: Minor cleanup to virDomainSnapshotAssignDef

When a future patch converts virDomainSnapshotDef to be a virObject,
we need to be careful that converting VIR_FREE() to virObjectUnref()
does not result in double frees. Reorder the assignment of def into
the object to the point after object is in the hash table (as
otherwise the virHashAddEntry() error path would have a shot at
freeing def prematurely).

Suggested-by: John Ferlan <ferlan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/virdomainsnapshotobjlist.c