diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2016-10-02 18:47:16 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2016-10-02 18:47:16 +0200 |
commit | 0ebc0ed6a3e3b7acc9f9e338cc23cea5f4f22f61 (patch) | |
tree | 68e5083e294117d451e23a0f6a5cecdf2386adc4 | |
parent | ba25d2b2a84a31eac2956b71cb12b4b0748b35f5 (diff) |
Avoid double free when iob_addbuf_free fails, thanks to Sami Farin
-rw-r--r-- | proxy.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -715,8 +715,7 @@ unlock_continue: | |||
715 | void *tmp = malloc( mem ); | 715 | void *tmp = malloc( mem ); |
716 | if( tmp ) { | 716 | if( tmp ) { |
717 | memcpy( tmp, ptr, mem ); | 717 | memcpy( tmp, ptr, mem ); |
718 | if( !iob_addbuf_free( &g_connections[i].outdata, tmp, mem ) ) | 718 | iob_addbuf_free( &g_connections[i].outdata, tmp, mem ); |
719 | free( tmp ); | ||
720 | io_wantwrite( g_connections[i].fd ); | 719 | io_wantwrite( g_connections[i].fd ); |
721 | } | 720 | } |
722 | } | 721 | } |