snapshot: Minor cleanup to virDomainSnapshotAssignDef
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 <ec807315aa16887018556aff98eb3d5b68b3e9bd@redhat.com>
Signed-off-by: Eric Blake <a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com>

jfehlig/libvirt,eskultety/libvirt,crobinso/libvirt,fabianfreyer/libvirt,libvirt/libvirt,crobinso/libvirt,andreabolognani/libvirt,zippy2/libvirt,jardasgit/libvirt,zippy2/libvirt,jfehlig/libvirt,eskultety/libvirt,jardasgit/libvirt,jfehlig/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,eskultety/libvirt,olafhering/libvirt,nertpinx/libvirt,olafhering/libvirt,jfehlig/libvirt,crobinso/libvirt,olafhering/libvirt,eskultety/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,nertpinx/libvirt,nertpinx/libvirt,jardasgit/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,libvirt/libvirt,eskultety/libvirt,zippy2/libvirt,libvirt/libvirt