* network.c (closedown_network): Free each connection data structure while
authorKen Raeburn <raeburn@mit.edu>
Fri, 24 Sep 2004 02:21:47 +0000 (02:21 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 24 Sep 2004 02:21:47 +0000 (02:21 +0000)
closing file descriptors.

ticket: 1210

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16789 dc483132-0cff-0310-8789-dd5450dbe970

src/kdc/ChangeLog
src/kdc/network.c

index 64cb0ab4b20a1ce4a68e54b063367df63ceac022..69f392c5195ddbf0e0bb4e2ba33dfcbe52a01b8c 100644 (file)
@@ -1,5 +1,8 @@
 2004-09-23  Ken Raeburn  <raeburn@mit.edu>
 
+       * network.c (closedown_network): Free each connection data
+       structure while closing file descriptors.
+
        * kdc_util.h (sockaddr2p): Don't declare.
 
 2004-07-23  Tom Yu  <tlyu@mit.edu>
index a7bfbc8fa913e1d4a8cae6f2522d47f595678923..d05057aca89bd2e41288e3c5b74dfb7683d97ac2 100644 (file)
@@ -1069,6 +1069,11 @@ closedown_network(const char *prog)
        if (conn->fd >= 0)
            (void) close(conn->fd);
        DEL (connections, i);
+       /* There may also be per-connection data in the tcp structure
+          (tcp.buffer, tcp.response) that we're not freeing here.
+          That should only happen if we quit with a connection in
+          progress.  */
+       free(conn);
     }
     FREE_SET_DATA(connections);
     FREE_SET_DATA(udp_port_data);