From: Edward Hervey Date: Thu, 21 Nov 2019 15:38:35 +0000 (+0100) Subject: webrtcdatachannels: Don't leak strings X-Git-Tag: 1.19.3~507^2~2644 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=706ec236ac98c7e607b13f5da565a378c8e18151;p=platform%2Fupstream%2Fgstreamer.git webrtcdatachannels: Don't leak strings They would leak in error cases CID: 1455480 --- diff --git a/ext/webrtc/webrtcdatachannel.c b/ext/webrtc/webrtcdatachannel.c index 3acb7c1..139ec7a 100644 --- a/ext/webrtc/webrtcdatachannel.c +++ b/ext/webrtc/webrtcdatachannel.c @@ -432,6 +432,8 @@ _parse_control_packet (GstWebRTCDataChannel * channel, guint8 * data, { GstByteReader r; guint8 message_type; + gchar *label = NULL; + gchar *proto = NULL; if (!data) g_return_val_if_reached (GST_FLOW_ERROR); @@ -452,7 +454,6 @@ _parse_control_packet (GstWebRTCDataChannel * channel, guint8 * data, guint32 reliability_param; guint16 priority, label_len, proto_len; const guint8 *src; - gchar *label, *proto; GstBuffer *buffer; GstFlowReturn ret; @@ -536,6 +537,8 @@ _parse_control_packet (GstWebRTCDataChannel * channel, guint8 * data, parse_error: { + g_free (label); + g_free (proto); g_set_error (error, GST_WEBRTC_BIN_ERROR, GST_WEBRTC_BIN_ERROR_DATA_CHANNEL_FAILURE, "Failed to parse packet"); g_return_val_if_reached (GST_FLOW_ERROR);