From e1e254d8c2506469cc4143b7a216c61389001ab6 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sat, 13 Oct 2012 17:32:23 +0000 Subject: [PATCH] fix NULL-pointer-dereference regression introduced in r13546 for #5069. --- libtransmission/webseed.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libtransmission/webseed.c b/libtransmission/webseed.c index a7edcf1af..82c2474a4 100644 --- a/libtransmission/webseed.c +++ b/libtransmission/webseed.c @@ -80,9 +80,12 @@ webseed_free( struct tr_webseed * w ) const tr_info * inf = tr_torrentInfo( tor ); tr_file_index_t i; - for( i=0; ifileCount; ++i ) - tr_free( w->file_urls[i] ); - tr_free( w->file_urls ); + /* if we have an array of file URLs, free it */ + if( w->file_urls != NULL ) { + for( i=0; ifileCount; ++i ) + tr_free( w->file_urls[i] ); + tr_free( w->file_urls ); + } /* webseed destruct */ event_free( w->timer ); -- 2.40.0