From 82d5b54109a8409df48f0b9a02add1dcce01780b Mon Sep 17 00:00:00 2001 From: Petri Hintukainen Date: Thu, 24 Nov 2011 11:46:07 +0200 Subject: Fixed leaks in input plugins --HG-- branch : point-release --- src/input/input_smb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/input/input_smb.c') diff --git a/src/input/input_smb.c b/src/input/input_smb.c index d82ab0aa7..e3ad51eb1 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -356,7 +356,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); }else - memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); + MRL_ZERO(this->mrls[num_files]); MRL_DUPLICATE(&dir_files[i], this->mrls[num_files]); @@ -373,7 +373,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); }else - memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); + MRL_ZERO(this->mrls[num_files]); MRL_DUPLICATE(&norm_files[i], this->mrls[num_files]); @@ -456,6 +456,12 @@ smb_class_dispose (input_class_t *this_gen) { smb_input_class_t *this = (smb_input_class_t *) this_gen; + while(this->mrls_allocated_entries) { + MRL_ZERO(this->mrls[this->mrls_allocated_entries - 1]); + free(this->mrls[this->mrls_allocated_entries--]); + } + free(this->mrls); + free (this); } -- cgit v1.2.3