summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input/http_helper.c30
-rw-r--r--src/input/input_dvd.c6
-rw-r--r--src/input/input_file.c10
-rw-r--r--src/input/input_http.c14
4 files changed, 22 insertions, 38 deletions
diff --git a/src/input/http_helper.c b/src/input/http_helper.c
index 6ef1a3f40..9f073cc58 100644
--- a/src/input/http_helper.c
+++ b/src/input/http_helper.c
@@ -208,29 +208,13 @@ int _x_parse_url (char *url, char **proto, char** host, int *port,
return 1;
error:
- if (*proto) {
- free (*proto);
- *proto = NULL;
- }
- if (*user) {
- free (*user);
- *user = NULL;
- }
- if (*password) {
- free (*password);
- *password = NULL;
- }
- if (*host) {
- free (*host);
- *host = NULL;
- }
- if (*port) {
- *port = 0;
- }
- if (*uri) {
- free (*uri);
- *uri = NULL;
- }
+ _x_freep (proto);
+ _x_freep (user);
+ _x_freep (password);
+ _x_freep (host);
+ _x_freep (uri);
+ *port = 0;
+
return 0;
}
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 69010ff3f..c7640dd17 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -569,8 +569,8 @@ static void dvd_plugin_free_buffer(buf_element_t *buf) {
if (this->freeing && !this->mem_stack) {
/* all buffers returned, we can free the plugin now */
pthread_mutex_destroy(&this->buf_mutex);
- free(this->mem);
- free(this->mrl);
+ _x_freep(&this->mem);
+ _x_freep(&this->mrl);
free(this);
}
}
@@ -1726,7 +1726,7 @@ static void dvd_class_dispose(input_class_t *this_gen) {
config->unregister_callback(config, "media.dvd.seek_behaviour");
config->unregister_callback(config, "media.dvd.play_single_chapter");
- free(this->eject_device);
+ _x_freep(&this->eject_device);
free(this);
}
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 9e49faec1..adf8c4974 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -329,7 +329,7 @@ static void file_plugin_dispose (input_plugin_t *this_gen ) {
if (this->fh != -1)
close(this->fh);
- free (this->mrl);
+ _x_freep (&this->mrl);
free (this);
}
@@ -376,7 +376,7 @@ static int file_plugin_open (input_plugin_t *this_gen ) {
return -1;
}
- free(filename);
+ _x_freep(&filename);
#ifdef HAVE_MMAP
this->mmap_on = 0;
@@ -915,7 +915,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
*/
while(this->mrls_allocated_entries > num_files) {
MRL_ZERO(this->mrls[this->mrls_allocated_entries - 1]);
- free(this->mrls[this->mrls_allocated_entries--]);
+ _x_freep(&this->mrls[this->mrls_allocated_entries--]);
}
/*
@@ -947,9 +947,9 @@ static void file_class_dispose (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--]);
+ _x_freep(&this->mrls[this->mrls_allocated_entries--]);
}
- free (this->mrls);
+ _x_freep (&this->mrls);
free (this);
}
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 1168abde5..d4f628f9a 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -603,12 +603,12 @@ static void http_plugin_dispose (input_plugin_t *this_gen ) {
this->nbc = NULL;
}
- if (this->mrl) free(this->mrl);
- if (this->proto) free(this->proto);
- if (this->host) free(this->host);
- if (this->user) free(this->user);
- if (this->password) free(this->password);
- if (this->uri) free(this->uri);
+ _x_freep (&this->mrl);
+ _x_freep (&this->proto);
+ _x_freep (&this->host);
+ _x_freep (&this->user);
+ _x_freep (&this->password);
+ _x_freep (&this->uri);
free (this);
}
@@ -1040,7 +1040,7 @@ static input_plugin_t *http_class_get_instance (input_class_t *cls_gen, xine_str
static void http_class_dispose (input_class_t *this_gen) {
http_input_class_t *this = (http_input_class_t *) this_gen;
- free(this->proxyhost_env);
+ _x_freep(&this->proxyhost_env);
free (this);
}