ad886fa util: identity: Harden virIdentitySetCurrent()

Authored and Committed by Peter Krempa 9 years ago
    util: identity: Harden virIdentitySetCurrent()
    
    Don't unref the old identity unless we set the new one correctly and
    unref the new one on failure to set it so that we don't leak any
    references or use invalid pointers.
    
        
file modified
+3 -1