{
GstRTSPResult res = GST_RTSP_OK;
GstWFDSrc *src = GST_WFD_SRC (bsrc);
+ GCancellable *cancellable;
- if (GST_RTSP_OK != gst_rtsp_connection_accept (src->tcp, &src->tcp_connection, g_cancellable_new())) {
+ cancellable = g_cancellable_new();
+
+ if (GST_RTSP_OK != gst_rtsp_connection_accept (src->tcp, &src->tcp_connection, cancellable)) {
g_socket_close (src->tcp, NULL);
GST_ERROR ("Failed to accept connection");
+ g_object_unref(cancellable);
return GST_RTSP_ERROR;
} else {
g_socket_close (src->tcp, NULL);