From: Thibault Saunier Date: Sat, 10 May 2014 20:52:18 +0000 (+0200) Subject: ges: Do not use freed pointers X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2c8a9efb36d3cb3eeeccb06d67ad040e79b8bcb;p=platform%2Fupstream%2Fgst-editing-services.git ges: Do not use freed pointers COVERTY CID 1212182 COVERTY CID 1212184 COVERTY CID 1212185 --- diff --git a/ges/ges-base-xml-formatter.c b/ges/ges-base-xml-formatter.c index 626ba06..04b3513 100644 --- a/ges/ges-base-xml-formatter.c +++ b/ges/ges-base-xml-formatter.c @@ -555,9 +555,9 @@ _free_pending_asset (GESBaseXmlFormatterPrivate * priv, PendingAsset * passet) g_free (passet->metadatas); if (passet->properties) gst_structure_free (passet->properties); - g_slice_free (PendingAsset, passet); priv->pending_assets = g_list_remove (priv->pending_assets, passet); + g_slice_free (PendingAsset, passet); } static void diff --git a/tools/ges-launch.c b/tools/ges-launch.c index 63f2b66..99d74f4 100644 --- a/tools/ges-launch.c +++ b/tools/ges-launch.c @@ -445,9 +445,6 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path, ges_timeline_commit (timeline); - if (uri) - g_free (uri); - /* save project if path is given. we do this now in case GES crashes or * hangs during playback. */ if (save_path && !load_path) { @@ -457,7 +454,6 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path, goto failure; } ges_timeline_save_to_uri (timeline, uri, NULL, TRUE, NULL); - g_free (uri); } /* In order to view our timeline, let's grab a convenience pipeline to put @@ -479,17 +475,23 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path, goto failure; *ret_timeline = timeline; + +done: + if (uri) + g_free (uri); + return pipeline; failure: { - if (uri) - g_free (uri); if (timeline) gst_object_unref (timeline); if (pipeline) gst_object_unref (pipeline); - return NULL; + pipeline = NULL; + timeline = NULL; + + goto done; } } @@ -587,7 +589,6 @@ static GstEncodingProfile * _parse_encoding_profile (const gchar * format) { GstCaps *caps; - char *preset_name = NULL; GstEncodingProfile *encoding_profile; gchar **restriction_format, **preset_v; @@ -610,8 +611,9 @@ _parse_encoding_profile (const gchar * format) } for (i = 1; strcaps_v[i]; i++) { - GstEncodingProfile *profile = NULL; gchar *strcaps, *strpresence; + char *preset_name = NULL; + GstEncodingProfile *profile = NULL; restriction_format = g_strsplit (strcaps_v[i], "->", 0); if (restriction_format[1]) {