Add g_free about GstElements which is not freed. 01/162901/4
authorHyunsoo Park <hance.park@samsung.com>
Wed, 6 Dec 2017 05:59:08 +0000 (14:59 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Thu, 7 Dec 2017 03:13:12 +0000 (12:13 +0900)
On doing '_rtsp_media_factory_wfd_create_videotest_bin' and '_rtsp_media_factory_wfd_create_xcapture_bin' api,
it can go to 'create_error' label, when something goes wrong.
But on 'create_error' label, i found that variables which is allocated memory by 'gst_element_factory_make' are doesn't freed.

So i added 'g_free' about that

Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
Change-Id: Iba25ba4b8056fe95dfa3ae47f40615a3a41cca18

gst/rtsp-server/rtsp-media-factory-wfd.c
packaging/gst-rtsp-server.spec

index 6dae410..5a0fc34 100644 (file)
@@ -818,6 +818,13 @@ _rtsp_media_factory_wfd_create_videotest_bin (GstRTSPMediaFactoryWFD * factory,
   return TRUE;
 
 create_error:
+  gst_object_unref(videosrc);
+  gst_object_unref(vcaps);
+  gst_object_unref(videoconvert);
+  gst_object_unref(venc_caps);
+  gst_object_unref(venc);
+  gst_object_unref(vparse);
+  gst_object_unref(vqueue);
   return FALSE;
 }
 
@@ -1111,6 +1118,14 @@ _rtsp_media_factory_wfd_create_xcapture_bin (GstRTSPMediaFactoryWFD * factory,
   return TRUE;
 
 create_error:
+  gst_object_unref(videosrc);
+  gst_object_unref(vcaps);
+  gst_object_unref(venc_caps);
+  gst_object_unref(videoconvert);
+  gst_object_unref(videoscale);
+  gst_object_unref(venc);
+  gst_object_unref(vparse);
+  gst_object_unref(vqueue);
   return FALSE;
 }
 
index ef994d6..c6df3e1 100644 (file)
@@ -1,7 +1,7 @@
 Name:       gst-rtsp-server
 Summary:    Multimedia Framework Library
 Version:    1.6.1
-Release:    21
+Release:    22
 Url:        http://gstreamer.freedesktop.org/
 Group:      System/Libraries
 License:    LGPL-2.0+
@@ -32,7 +32,7 @@ Requires:   %{name} = %{version}-%{release}
 
 %prep
 %setup -q -n gst-rtsp-server-%{version}
-%setup -q -T -D -a 100 
+%setup -q -T -D -a 100
 
 %build