summaryrefslogtreecommitdiff
path: root/proxy.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2016-10-02 18:47:16 +0200
committerDirk Engling <erdgeist@erdgeist.org>2016-10-02 18:47:16 +0200
commit0ebc0ed6a3e3b7acc9f9e338cc23cea5f4f22f61 (patch)
tree68e5083e294117d451e23a0f6a5cecdf2386adc4 /proxy.c
parentba25d2b2a84a31eac2956b71cb12b4b0748b35f5 (diff)
Avoid double free when iob_addbuf_free fails, thanks to Sami Farin
Diffstat (limited to 'proxy.c')
-rw-r--r--proxy.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/proxy.c b/proxy.c
index 82789cb..1f09777 100644
--- a/proxy.c
+++ b/proxy.c
@@ -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 }