tcpserversink: Don't leak a GSocket
and a GInetSocketAddress
when accepting a connection. Discovered by `make check-valgrind` with the new `socketintegrationtest`. https://bugzilla.gnome.org/show_bug.cgi?id=739544
This commit is contained in:
parent
5b0ec93e99
commit
ffb43c0591
@ -677,6 +677,10 @@ gst_multi_handle_sink_add_full (GstMultiHandleSink * sink,
|
|||||||
if (clink != NULL)
|
if (clink != NULL)
|
||||||
goto duplicate;
|
goto duplicate;
|
||||||
|
|
||||||
|
/* We do not take ownership of @handle in this function, but we can't take a
|
||||||
|
* reference directly as we don't know the concrete type of the handle.
|
||||||
|
* GstMultiHandleSink relies on the derived class to take a reference for us
|
||||||
|
* in new_client: */
|
||||||
mhclient = mhsinkclass->new_client (mhsink, handle, sync_method);
|
mhclient = mhsinkclass->new_client (mhsink, handle, sync_method);
|
||||||
|
|
||||||
/* we can add the handle now */
|
/* we can add the handle now */
|
||||||
|
@ -163,6 +163,7 @@ gst_tcp_server_sink_handle_server_read (GstTCPServerSink * sink)
|
|||||||
goto accept_failed;
|
goto accept_failed;
|
||||||
|
|
||||||
handle.socket = client_socket;
|
handle.socket = client_socket;
|
||||||
|
/* gst_multi_handle_sink_add does not take ownership of client_socket */
|
||||||
gst_multi_handle_sink_add (GST_MULTI_HANDLE_SINK (sink), handle);
|
gst_multi_handle_sink_add (GST_MULTI_HANDLE_SINK (sink), handle);
|
||||||
|
|
||||||
#ifndef GST_DISABLE_GST_DEBUG
|
#ifndef GST_DISABLE_GST_DEBUG
|
||||||
@ -177,9 +178,11 @@ gst_tcp_server_sink_handle_server_read (GstTCPServerSink * sink)
|
|||||||
ip, g_inet_socket_address_get_port (addr), client_socket);
|
ip, g_inet_socket_address_get_port (addr), client_socket);
|
||||||
|
|
||||||
g_free (ip);
|
g_free (ip);
|
||||||
|
g_object_unref (addr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_object_unref (client_socket);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user