summaryrefslogtreecommitdiff
path: root/gst/librfb
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2013-05-11 00:36:06 +0100
committerTim-Philipp Müller <tim@centricular.net>2013-05-11 00:36:06 +0100
commit4cfa3f5af32f61d298e61cf341ad8045c937eb60 (patch)
treeafbaadfd6d56e92ce175ad0217d6aa9927a6bd78 /gst/librfb
parent14d20271c1672ec938275deda20448e6c6ee7336 (diff)
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.
Diffstat (limited to 'gst/librfb')
-rw-r--r--gst/librfb/gstrfbsrc.c2
-rw-r--r--gst/librfb/rfbdecoder.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gst/librfb/gstrfbsrc.c b/gst/librfb/gstrfbsrc.c
index e5d213b24..9db0bd6f7 100644
--- a/gst/librfb/gstrfbsrc.c
+++ b/gst/librfb/gstrfbsrc.c
@@ -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;
}
diff --git a/gst/librfb/rfbdecoder.c b/gst/librfb/rfbdecoder.c
index edc18ec11..3677b345b 100644
--- a/gst/librfb/rfbdecoder.c
+++ b/gst/librfb/rfbdecoder.c
@@ -88,6 +88,8 @@ rfb_decoder_free (RfbDecoder * decoder)
if (decoder->data)
g_free (decoder->data);
+
+ g_free (decoder);
}
gboolean