remote: Don't call NULL closeFreeCallback

Check function pointer before calling.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
Viktor Mihajlovski 2013-03-26 10:54:54 +01:00 committed by Peter Krempa
parent d8d4aa01d8
commit d0cc811ed0
1 changed files with 2 additions and 1 deletions

View File

@ -358,7 +358,8 @@ static void remoteClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
closeCallback(conn, reason, closeOpaque);
virMutexLock(&conn->lock);
conn->closeDispatch = false;
if (conn->closeUnregisterCount != closeUnregisterCount)
if (conn->closeUnregisterCount != closeUnregisterCount &&
closeFreeCallback)
closeFreeCallback(closeOpaque);
}
virMutexUnlock(&conn->lock);