gst/tcp/: Don't leak the hostname when shutting down.

Original commit message from CVS:
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_class_init),
(gst_tcpclientsink_finalize):
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_class_init),
(gst_tcpclientsrc_finalize):
* gst/tcp/gsttcpserversink.c: (gst_tcpserversink_class_init),
(gst_tcpserversink_init), (gst_tcpserversink_finalize):
* gst/tcp/gsttcpserversrc.c: (gst_tcpserversrc_class_init),
(gst_tcpserversrc_init), (gst_tcpserversrc_finalize):
Don't leak the hostname when shutting down.
In tcpserversrc, take a copy of the default hostname.
This commit is contained in:
Jan Schmidt 2005-02-02 06:26:15 +00:00
parent 3633123b80
commit a1a0c43c24
5 changed files with 55 additions and 1 deletions

View file

@ -1,3 +1,16 @@
2005-02-02 Jan Schmidt <thaytan@mad.scientist.com>
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_class_init),
(gst_tcpclientsink_finalize):
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_class_init),
(gst_tcpclientsrc_finalize):
* gst/tcp/gsttcpserversink.c: (gst_tcpserversink_class_init),
(gst_tcpserversink_init), (gst_tcpserversink_finalize):
* gst/tcp/gsttcpserversrc.c: (gst_tcpserversrc_class_init),
(gst_tcpserversrc_init), (gst_tcpserversrc_finalize):
Don't leak the hostname when shutting down.
In tcpserversrc, take a copy of the default hostname.
2005-02-01 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/raw1394/gstdv1394src.c: (gst_dv1394src_iso_receive):

View file

@ -56,6 +56,7 @@ enum
static void gst_tcpclientsink_base_init (gpointer g_class);
static void gst_tcpclientsink_class_init (GstTCPClientSink * klass);
static void gst_tcpclientsink_init (GstTCPClientSink * tcpclientsink);
static void gst_tcpclientsink_finalize (GObject * gobject);
static void gst_tcpclientsink_set_clock (GstElement * element,
GstClock * clock);
@ -132,6 +133,7 @@ gst_tcpclientsink_class_init (GstTCPClientSink * klass)
G_PARAM_READWRITE));
gobject_class->set_property = gst_tcpclientsink_set_property;
gobject_class->get_property = gst_tcpclientsink_get_property;
gobject_class->finalize = gst_tcpclientsink_finalize;
gstelement_class->change_state = gst_tcpclientsink_change_state;
gstelement_class->set_clock = gst_tcpclientsink_set_clock;
@ -169,6 +171,14 @@ gst_tcpclientsink_init (GstTCPClientSink * this)
this->clock = NULL;
}
static void
gst_tcpclientsink_finalize (GObject * gobject)
{
GstTCPClientSink *this = GST_TCPCLIENTSINK (gobject);
g_free (this->host);
}
static void
gst_tcpclientsink_chain (GstPad * pad, GstData * _data)
{

View file

@ -67,6 +67,7 @@ enum
static void gst_tcpclientsrc_base_init (gpointer g_class);
static void gst_tcpclientsrc_class_init (GstTCPClientSrc * klass);
static void gst_tcpclientsrc_init (GstTCPClientSrc * tcpclientsrc);
static void gst_tcpclientsrc_finalize (GObject * gobject);
static GstCaps *gst_tcpclientsrc_getcaps (GstPad * pad);
@ -144,6 +145,7 @@ gst_tcpclientsrc_class_init (GstTCPClientSrc * klass)
gobject_class->set_property = gst_tcpclientsrc_set_property;
gobject_class->get_property = gst_tcpclientsrc_get_property;
gobject_class->finalize = gst_tcpclientsrc_finalize;
gstelement_class->change_state = gst_tcpclientsrc_change_state;
gstelement_class->set_clock = gst_tcpclientsrc_set_clock;
@ -182,6 +184,14 @@ gst_tcpclientsrc_init (GstTCPClientSrc * this)
GST_FLAG_UNSET (this, GST_TCPCLIENTSRC_OPEN);
}
static void
gst_tcpclientsrc_finalize (GObject * gobject)
{
GstTCPClientSrc *this = GST_TCPCLIENTSRC (gobject);
g_free (this->host);
}
static GstCaps *
gst_tcpclientsrc_getcaps (GstPad * pad)
{

View file

@ -55,6 +55,7 @@ enum
static void gst_tcpserversink_base_init (gpointer g_class);
static void gst_tcpserversink_class_init (GstTCPServerSink * klass);
static void gst_tcpserversink_init (GstTCPServerSink * tcpserversink);
static void gst_tcpserversink_finalize (GObject * gobject);
static gboolean gst_tcpserversink_handle_wait (GstMultiFdSink * sink,
GstFDSet * set);
@ -127,6 +128,7 @@ gst_tcpserversink_class_init (GstTCPServerSink * klass)
gobject_class->set_property = gst_tcpserversink_set_property;
gobject_class->get_property = gst_tcpserversink_get_property;
gobject_class->finalize = gst_tcpserversink_finalize;
gstmultifdsink_class->init = gst_tcpserversink_init_send;
gstmultifdsink_class->wait = gst_tcpserversink_handle_wait;
@ -142,10 +144,19 @@ gst_tcpserversink_init (GstTCPServerSink * this)
this->server_port = TCP_DEFAULT_PORT;
/* should support as minimum 576 for IPV4 and 1500 for IPV6 */
/* this->mtu = 1500; */
this->host = g_strdup (TCP_DEFAULT_HOST);
this->server_sock.fd = -1;
}
static void
gst_tcpserversink_finalize (GObject * gobject)
{
GstTCPServerSink *this = GST_TCPSERVERSINK (gobject);
g_free (this->host);
}
/* handle a read request on the server,
* which indicates a new client connection */
static gboolean

View file

@ -63,6 +63,7 @@ enum
static void gst_tcpserversrc_base_init (gpointer g_class);
static void gst_tcpserversrc_class_init (GstTCPServerSrc * klass);
static void gst_tcpserversrc_init (GstTCPServerSrc * tcpserversrc);
static void gst_tcpserversrc_finalize (GObject * gobject);
static GstData *gst_tcpserversrc_get (GstPad * pad);
static GstElementStateReturn gst_tcpserversrc_change_state (GstElement *
@ -137,6 +138,7 @@ gst_tcpserversrc_class_init (GstTCPServerSrc * klass)
gobject_class->set_property = gst_tcpserversrc_set_property;
gobject_class->get_property = gst_tcpserversrc_get_property;
gobject_class->finalize = gst_tcpserversrc_finalize;
gstelement_class->change_state = gst_tcpserversrc_change_state;
gstelement_class->set_clock = gst_tcpserversrc_set_clock;
@ -164,7 +166,7 @@ gst_tcpserversrc_init (GstTCPServerSrc * this)
gst_pad_set_get_function (this->srcpad, gst_tcpserversrc_get);
this->server_port = TCP_DEFAULT_PORT;
this->host = TCP_DEFAULT_HOST;
this->host = g_strdup (TCP_DEFAULT_HOST);
this->clock = NULL;
this->server_sock_fd = -1;
this->client_sock_fd = -1;
@ -174,6 +176,14 @@ gst_tcpserversrc_init (GstTCPServerSrc * this)
GST_FLAG_UNSET (this, GST_TCPSERVERSRC_OPEN);
}
static void
gst_tcpserversrc_finalize (GObject * gobject)
{
GstTCPServerSrc *this = GST_TCPSERVERSRC (gobject);
g_free (this->host);
}
/* read the gdp caps packet from the socket */
static GstCaps *
gst_tcpserversrc_gdp_read_caps (GstTCPServerSrc * this)