gst/tcp/: Fix some memory leaks.

Original commit message from CVS:
* gst/tcp/gstfdset.c: (gst_fdset_free), (gst_fdset_wait):
* gst/tcp/gstmultifdsink.c: (gst_multifdsink_add),
(gst_multifdsink_remove_client_link),
(gst_multifdsink_client_queue_buffer),
(gst_multifdsink_handle_client_write):
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_init_send):
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_init_receive):
Fix some memory leaks.
This commit is contained in:
Wim Taymans 2004-08-30 10:28:40 +00:00
parent 28a56927b4
commit f8c64679ac
5 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,14 @@
2004-08-30 Wim Taymans <wim@fluendo.com>
* gst/tcp/gstfdset.c: (gst_fdset_free), (gst_fdset_wait):
* gst/tcp/gstmultifdsink.c: (gst_multifdsink_add),
(gst_multifdsink_remove_client_link),
(gst_multifdsink_client_queue_buffer),
(gst_multifdsink_handle_client_write):
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_init_send):
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_init_receive):
Fix some memory leaks.
2004-08-30 Thomas Vander Stichele <thomas at apestaart dot org>
Patch by: David Schleef

View file

@ -135,6 +135,7 @@ gst_fdset_free (GstFDSet * set)
break;
case GST_FDSET_MODE_POLL:
g_free (set->pollfds);
g_mutex_free (set->poll_lock);
break;
case GST_FDSET_MODE_EPOLL:
g_warning ("implement me");

View file

@ -598,6 +598,11 @@ gst_multifdsink_remove_client_link (GstMultiFdSink * sink, GList * link)
g_get_current_time (&now);
client->disconnect_time = GST_TIMEVAL_TO_TIME (now);
/* free client buffers */
g_slist_foreach (client->sending, (GFunc) gst_data_unref, NULL);
g_slist_free (client->sending);
client->sending = NULL;
/* unlock the mutex before signaling because the signal handler
* might query some properties */
g_mutex_unlock (sink->clientslock);

View file

@ -329,6 +329,7 @@ gst_tcpclientsink_init_send (GstTCPClientSink * this)
this->server_sin.sin_family = AF_INET; /* network socket */
this->server_sin.sin_port = htons (this->port); /* on port */
this->server_sin.sin_addr.s_addr = inet_addr (ip); /* on host ip */
g_free (ip);
GST_DEBUG_OBJECT (this, "connecting to server");
ret = connect (this->sock_fd, (struct sockaddr *) &this->server_sin,

View file

@ -432,6 +432,7 @@ gst_tcpclientsrc_init_receive (GstTCPClientSrc * this)
this->server_sin.sin_family = AF_INET; /* network socket */
this->server_sin.sin_port = htons (this->port); /* on port */
this->server_sin.sin_addr.s_addr = inet_addr (ip); /* on host ip */
g_free (ip);
GST_DEBUG_OBJECT (this, "connecting to server");
ret = connect (this->sock_fd, (struct sockaddr *) &this->server_sin,