fix memory leak
authorHyunjun Ko <zzoon.ko@samsung.com>
Tue, 14 Jul 2015 01:16:09 +0000 (10:16 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 14 Jul 2015 01:17:44 +0000 (18:17 -0700)
Change-Id: I77e7d8ca517ede8db55074ec6adc902749b405f3

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

index 54f1d4b..602f8d7 100644 (file)
@@ -833,7 +833,6 @@ _rtsp_media_factory_wfd_create_xvcapture_bin (GstRTSPMediaFactoryWFD * factory,
     GST_ERROR_OBJECT (factory, "Yet to support other than H264 format");
     goto create_error;
   }
-  if (vcodec) g_free (vcodec);
 
   venc = gst_element_factory_make (vcodec, "videoenc");
   if (!venc) {
@@ -866,10 +865,12 @@ _rtsp_media_factory_wfd_create_xvcapture_bin (GstRTSPMediaFactoryWFD * factory,
   }
 
   priv->video_queue = vqueue;
+  if (vcodec) g_free (vcodec);
 
   return TRUE;
 
 create_error:
+  if (vcodec) g_free (vcodec);
   return FALSE;
 }