summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-06-17 21:17:32 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-06-17 21:17:32 +0000
commit2a9c8bdb6976fa2b348def85de5f767c9c73a675 (patch)
tree1b2ec6f27f09622d3f8a1390bd7b77b9be5918dd
parentae3ab4e40eedc8097a8de0cfe397b5d6c62c2320 (diff)
downloadxine-lib-2a9c8bdb6976fa2b348def85de5f767c9c73a675.tar.gz
xine-lib-2a9c8bdb6976fa2b348def85de5f767c9c73a675.tar.bz2
Few memory leaks.
CVS patchset: 2090 CVS date: 2002/06/17 21:17:32
-rw-r--r--src/input/input_cda.c25
-rw-r--r--src/input/input_dvd.c6
-rw-r--r--src/input/input_vcd.c4
3 files changed, 16 insertions, 19 deletions
diff --git a/src/input/input_cda.c b/src/input/input_cda.c
index f64a0a379..89d9dd478 100644
--- a/src/input/input_cda.c
+++ b/src/input/input_cda.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_cda.c,v 1.25 2002/06/12 12:22:34 f1rmb Exp $
+ * $Id: input_cda.c,v 1.26 2002/06/17 21:17:32 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -199,10 +199,7 @@ static void _cda_stop_cd(cdainfo_t *);
static void device_change_cb(void *data, cfg_entry_t *cfg) {
cda_input_plugin_t *this = (cda_input_plugin_t *) data;
- if(this->cda->device_name)
- free(this->cda->device_name);
-
- this->cda->device_name = strdup(cfg->str_value);
+ this->cda->device_name = cfg->str_value;
}
static void server_change_cb(void *data, cfg_entry_t *cfg) {
cda_input_plugin_t *this = (cda_input_plugin_t *) data;
@@ -990,6 +987,7 @@ static int _cda_open_cd(cdainfo_t *cda) {
if(cda == NULL)
return 0;
+
#ifdef NON_BLOCKING
if((cda->fd = open(cda->device_name, O_RDONLY | O_NONBLOCK)) < 0) {
#else
@@ -1339,11 +1337,10 @@ static void _cda_free_cda(cdainfo_t *cda) {
_cda_close_cd(cda);
- if(cda->device_name)
- free(cda->device_name);
- if(cda->track)
+ if(cda->track) {
free(cda->track);
- free(cda);
+ cda->track = NULL;
+ }
}
/*
@@ -1776,7 +1773,7 @@ static void cda_plugin_dispose (input_plugin_t *this_gen ) {
for (i = 0; i < 100; i++)
free (this->filelist[i]);
- free (this->cda->device_name);
+ _cda_free_cda(this->cda);
free (this->cda);
free (this->mrls);
free (this);
@@ -1840,10 +1837,10 @@ input_plugin_t *init_input_plugin (int iface, xine_t *xine) {
this->cda->cur_track = -1;
this->cda->cur_pos = -1;
- this->cda->device_name = strdup(config->register_string(config, "input.cda_device", CDROM,
- _("path to your local cd audio device file"),
- NULL,
- device_change_cb, (void *) this));
+ this->cda->device_name = config->register_string(config, "input.cda_device", CDROM,
+ _("path to your local cd audio device file"),
+ NULL,
+ device_change_cb, (void *) this);
this->cddb.server = config->register_string(config, "input.cda_cddb_server", CDDB_SERVER,
_("cddbp server name"), NULL,
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 5362e972d..1a74273f4 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.50 2002/06/12 12:22:34 f1rmb Exp $
+ * $Id: input_dvd.c,v 1.51 2002/06/17 21:17:32 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -128,13 +128,13 @@ typedef struct {
static void device_change_cb(void *data, cfg_entry_t *cfg) {
dvd_input_plugin_t *this = (dvd_input_plugin_t *) data;
- this->device = strdup(cfg->str_value);
+ this->device = cfg->str_value;
}
static void rawdevice_change_cb(void *data, cfg_entry_t *cfg) {
dvd_input_plugin_t *this = (dvd_input_plugin_t *) data;
- this->raw_device = strdup(cfg->str_value);
+ this->raw_device = cfg->str_value;
}
static int openDrive (dvd_input_plugin_t *this) {
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 5f336e6a1..f0947e802 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_vcd.c,v 1.43 2002/06/12 12:22:34 f1rmb Exp $
+ * $Id: input_vcd.c,v 1.44 2002/06/17 21:17:32 f1rmb Exp $
*
*/
@@ -145,7 +145,7 @@ typedef struct {
static void device_change_cb(void *data, cfg_entry_t *cfg) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) data;
- this->device = strdup(cfg->str_value);
+ this->device = cfg->str_value;
}
#if defined (__linux__) || defined(__sun)