#3 Chunk free()'d multiple times

closed-fixed
nobody
None
5
2007-03-28
2007-03-26
No

I'm getting this error with v1.7.0 on both OpenBSD/i386 4.0-stable and NetBSD/alpha 2.0 when disconnecting from a session where a local port forwarding is in place:

in free(): warning: chunk is already free.

On OpenBSD it causes a coredump when the program exits.

I've tracked it down to closeall(). It's being called at the end of main() and by exit() since it's registered using atexit().

This patch fixes it:

--- proxytunnel.c.orig 2007-03-23 22:26:00.000000000 -0600
+++ proxytunnel.c 2007-03-25 20:41:06.000000000 -0600
@@ -153,10 +153,14 @@
/*
* Close all streams
*/
- if (stunnel)
+ if (stunnel) {
stream_close(stunnel);
- if (std)
+ stunnel = NULL;
+ }
+ if (std) {
stream_close(std);
+ std = NULL;
+ }
}

/*

Discussion

  • Mark Janssen

    Mark Janssen - 2007-03-28
    • status: open --> closed-fixed
     
  • Mark Janssen

    Mark Janssen - 2007-03-28

    Logged In: YES
    user_id=31552
    Originator: NO

    Applied in r153

     

Log in to post a comment.