s4-messaging ensure we do not segfault on a NULL msg context in cleanup
authorAndrew Bartlett <abartlet@samba.org>
Fri, 26 Aug 2011 06:05:46 +0000 (16:05 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 26 Aug 2011 12:06:07 +0000 (14:06 +0200)
source4/lib/messaging/messaging.c

index 4a4adac16ffe812f87a7760f619b409a41ccaf03..7e017a97f942d5829cf18c837c5c77e83f283bea 100644 (file)
@@ -545,6 +545,10 @@ NTSTATUS imessaging_send_ptr(struct imessaging_context *msg, struct server_id se
 */
 int imessaging_cleanup(struct imessaging_context *msg)
 {
+       if (!msg) {
+               return 0;
+       }
+
        DEBUG(5,("imessaging: cleaning up %s\n", msg->path));
        unlink(msg->path);
        while (msg->names && msg->names[0]) {