summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@qt.io>2017-06-13 15:52:15 +0200
committerChristian Stromme <christian.stromme@qt.io>2017-09-29 10:35:56 +0000
commitbc5f38bf7665c23a41000df42c4c8b1d96a609da (patch)
treef722dbf6d6765c7736e6ecc4a1cc348729446d00
parent51b361faa703e157feaa0cfd79e7d473cb704811 (diff)
downloadqtmultimedia-bc5f38bf7665c23a41000df42c4c8b1d96a609da.tar.gz
Fix memory leak in CameraBinImageCapture
The element name needs to be released when we're done with it. Change-Id: I650671288bd143551188094b0d934e7da2028a2d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r--src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp
index df73b9d2c..29d7743ed 100644
--- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp
+++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp
@@ -305,7 +305,9 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message)
if (!element)
return false;
- QString elementName = QString::fromLatin1(gst_element_get_name(element));
+ gchar *name = gst_element_get_name(element);
+ QString elementName = QString::fromLatin1(name);
+ g_free(name);
#if !GST_CHECK_VERSION(1,0,0)
GstElementClass *elementClass = GST_ELEMENT_GET_CLASS(element);
QString elementLongName = elementClass->details.longname;