diff options
Diffstat (limited to 'src/input/input_smb.c')
-rw-r--r-- | src/input/input_smb.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/input/input_smb.c b/src/input/input_smb.c index b2211e2ae..f3c2c035d 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -345,7 +345,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]); @@ -362,7 +362,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]); @@ -440,6 +440,20 @@ smb_plugin_open (input_plugin_t *this_gen ) return 1; } +static void +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); +} + static input_plugin_t * smb_class_get_instance (input_class_t *class_gen, xine_stream_t *stream, const char *mrl) @@ -498,7 +512,7 @@ static void this->input_class.description = N_("CIFS/SMB input plugin based on libsmbclient"); this->input_class.get_dir = smb_class_get_dir; this->input_class.get_autoplay_list = NULL; - this->input_class.dispose = default_input_class_dispose; + this->input_class.dispose = smb_class_dispose; this->input_class.eject_media = NULL; _exit_error: |