From 6c4cd36cc5ced530a387327c4f6c576074424c6c Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Fri, 6 Sep 2002 18:13:10 +0000 Subject: introduce "const" fix some input plugins that would not copy the mrl on open CVS patchset: 2623 CVS date: 2002/09/06 18:13:10 --- src/input/input_net.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/input/input_net.c') diff --git a/src/input/input_net.c b/src/input/input_net.c index 9df193864..a4afe2375 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -139,13 +139,14 @@ static int host_connect(const char *host, int port, xine_t *xine) { return -1; } -static int net_plugin_open (input_plugin_t *this_gen, char *mrl) { +static int net_plugin_open (input_plugin_t *this_gen, const char *mrl) { net_input_plugin_t *this = (net_input_plugin_t *) this_gen; char *filename; char *pptr; int port = 7658; - this->mrl = strdup(mrl); /* FIXME: small memory leak */ + free(this->mrl); + this->mrl = strdup(mrl); if (!strncasecmp (mrl, "tcp://", 6)) { filename = (char *) &this->mrl[6]; @@ -170,8 +171,6 @@ static int net_plugin_open (input_plugin_t *this_gen, char *mrl) { return 0; } - this->mrl = strdup(mrl); /* FIXME: small memory leak */ - this->nbc = nbc_init (this->xine); return 1; @@ -328,6 +327,8 @@ static int net_plugin_get_optional_data (input_plugin_t *this_gen, } static void net_plugin_dispose (input_plugin_t *this_gen ) { + net_input_plugin_t *this = (net_input_plugin_t *) this_gen; + free (this->mrl); free (this_gen); } -- cgit v1.2.3