]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nmb agent memory free problems
authorLuke Leighton <lkcl@samba.org>
Sat, 4 Dec 1999 20:29:03 +0000 (20:29 +0000)
committerLuke Leighton <lkcl@samba.org>
Sat, 4 Dec 1999 20:29:03 +0000 (20:29 +0000)
(This used to be commit b4306cbf06f70dd9d2760bb005e15059d6f904f0)

source3/utils/nmb-agent.c

index 61959ba680748baf9a804d21dd8e399268395cf5..8a202d04fa93eee2fd35d7e7af6dfffc0bcfbad7 100644 (file)
@@ -56,19 +56,18 @@ terminate sockent connection
 ****************************************************************************/
 static void sock_redir_free(struct sock_redir *sock)
 {
-       close(sock->c);
-       sock->c = -1;
+       DEBUG(10,("sock_redir_free: %d\n", sock->c));
+       if (sock->c != -1)
+       {
+               close(sock->c);
+               sock->c = -1;
+       }
        if (sock->n != NULL)
        {
-#if 0
                free(sock->n);
-#endif
                sock->n = NULL;
        }
-#if 0
        free(sock);
-#endif
-       ZERO_STRUCTP(sock);
 }
 
 /****************************************************************************