]> granicus.if.org Git - mutt/commitdiff
patch-bac.tunnelreopen-1 from Brendan Cully.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 4 Sep 2001 09:18:32 +0000 (09:18 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 4 Sep 2001 09:18:32 +0000 (09:18 +0000)
mutt_tunnel.c

index 12aadce3a9102b822241e62c62f67d0d0662bdec..01e1d729c24aa56e801d880e59333b79965fb975 100644 (file)
@@ -45,10 +45,6 @@ static int tunnel_socket_write (CONNECTION* conn, const char* buf, size_t len);
 /* -- public functions -- */
 int mutt_tunnel_socket_setup (CONNECTION *conn)
 {
-  TUNNEL_DATA* tunnel = (TUNNEL_DATA*) safe_malloc (sizeof (TUNNEL_DATA));
-
-  conn->sockdata = tunnel;
-  
   conn->open = tunnel_socket_open;
   conn->close = tunnel_socket_close;
   conn->read = tunnel_socket_read;
@@ -59,11 +55,14 @@ int mutt_tunnel_socket_setup (CONNECTION *conn)
 
 static int tunnel_socket_open (CONNECTION *conn)
 {
-  TUNNEL_DATA* tunnel = (TUNNEL_DATA*) conn->sockdata;
+  TUNNEL_DATA* tunnel;
   int pid;
   int rc;
   int pin[2], pout[2];
 
+  tunnel = (TUNNEL_DATA*) safe_malloc (sizeof (TUNNEL_DATA));
+  conn->sockdata = tunnel;
+
   mutt_message (_("Connecting with \"%s\"..."), Tunnel);
 
   if ((rc = pipe (pin)) == -1)