diff --git a/gst_client/gst_client.c b/gst_client/gst_client.c index 6bf9699f..67494535 100644 --- a/gst_client/gst_client.c +++ b/gst_client/gst_client.c @@ -653,11 +653,12 @@ gstd_client_cmd_socket (gchar * name, gchar * arg, GstdClientData * data) g_string_free (response, TRUE); write_error: - g_io_stream_close (G_IO_STREAM (data->con), NULL, NULL); - g_object_unref (data->con); - data->con = NULL; - out: + if (data->con) { + g_io_stream_close (G_IO_STREAM (data->con), NULL, NULL); + g_object_unref (data->con); + data->con = NULL; + } return ret; }