diff --git a/src/security/security_manager.c b/src/security/security_manager.c index d57bab95c6..84d90ac184 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -48,7 +48,17 @@ struct _virSecurityManager { static virClassPtr virSecurityManagerClass; -static void virSecurityManagerDispose(void *obj); + +static +void virSecurityManagerDispose(void *obj) +{ + virSecurityManagerPtr mgr = obj; + + if (mgr->drv->close) + mgr->drv->close(mgr); + VIR_FREE(mgr->privateData); +} + static int virSecurityManagerOnceInit(void) { @@ -231,15 +241,6 @@ void *virSecurityManagerGetPrivateData(virSecurityManagerPtr mgr) } -static void virSecurityManagerDispose(void *obj) -{ - virSecurityManagerPtr mgr = obj; - - if (mgr->drv->close) - mgr->drv->close(mgr); - VIR_FREE(mgr->privateData); -} - const char * virSecurityManagerGetDriver(virSecurityManagerPtr mgr) {