[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/3] remote: Don't call NULL closeFreeCallback



On 03/26/13 10:54, Viktor Mihajlovski wrote:
Check function pointer before calling.

Signed-off-by: Viktor Mihajlovski <mihajlov linux vnet ibm com>
---
  src/remote/remote_driver.c |    3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 3721af9..885120e 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -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);


ACK. The free callback isn't mandatory in the setter function so here it can't be expected either.

Peter


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]