mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 00:28:21 +00:00
rfbsrc: fix rfbdecoder new/free asymetry and wrong free in error case
If rfb_decoder_new() allocates the decoder sructure, rfb_decoder_free() should free the structure. We should not free the decoder when an error occurs during connection - it holds lots of configuration/state and will be freed later in finalize.
This commit is contained in:
parent
14d20271c1
commit
4cfa3f5af3
2 changed files with 2 additions and 2 deletions
|
@ -201,7 +201,6 @@ gst_rfb_src_finalize (GObject * object)
|
|||
}
|
||||
if (src->decoder) {
|
||||
rfb_decoder_free (src->decoder);
|
||||
g_free (src->decoder);
|
||||
src->decoder = NULL;
|
||||
}
|
||||
|
||||
|
@ -434,7 +433,6 @@ gst_rfb_src_start (GstBaseSrc * bsrc)
|
|||
if (!rfb_decoder_connect_tcp (decoder, src->host, src->port)) {
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
|
||||
("Could not connect to host %s on port %d", src->host, src->port));
|
||||
rfb_decoder_free (decoder);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,8 @@ rfb_decoder_free (RfbDecoder * decoder)
|
|||
|
||||
if (decoder->data)
|
||||
g_free (decoder->data);
|
||||
|
||||
g_free (decoder);
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
Loading…
Reference in a new issue