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: NJohn Ferlan <ferlan@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
Showing
想要评论请 注册 或 登录