r14297: make sure we can go through the loop for than once
[bbaumbach/samba-autobuild/.git] / source4 / libcli / dgram / mailslot.c
index 33bca166ce93a2dca480c85986ed56268ca3b9e6..467289bcee3d7b634900293ee8f5c7769c6db884 100644 (file)
@@ -137,7 +137,9 @@ struct dgram_mailslot_handler *dgram_mailslot_temp(struct nbt_dgram_socket *dgms
                }
                dgmslot = dgram_mailslot_listen(dgmsock, name, handler, private);
                talloc_free(name);
-               return dgmslot;
+               if (dgmslot != NULL) {
+                       return dgmslot;
+               }
        }
        DEBUG(2,("Unable to create temporary mailslot from %s\n", mailslot_name));
        return NULL;