[Icecast-dev] [PATCH 30/31] connection: _close set everything to NULL on the way out

Niv Sardi
Fri, 30 Jul 2010 14:54:52 -0000

src/connection.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index f1f8a9c..ff694af 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1410,10 +1410,10 @@ void connection_close(connection_t *con)
     WARN("destroying con = %p for fd =%d on %d.", con, con->sock,
con->serversock);

     sock_close(con->sock);
-    if (con->ip) free(con->ip);
-    if (con->host) free(con->host);
+    if (con->ip) { free(con->ip); con->ip = NULL; };
+    if (con->host) { free(con->host); con->host = NULL; };
 #ifdef HAVE_OPENSSL
-    if (con->ssl) { SSL_shutdown (con->ssl); SSL_free (con->ssl); }
+    if (con->ssl) { SSL_shutdown (con->ssl); SSL_free (con->ssl);
con->ssl = NULL; };
 #endif
     free(con);
 }
--
1.7.1