bilboed gstreamer: gstreamer/ gstreamer/plugins/elements/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gstreamer
Changes by:     bilboed
Date:           Mon Nov 24 2008  11:56:58 UTC

Log message:
* plugins/elements/gstfilesrc.c: (gst_file_src_uri_set_uri):
Fix memory leak.

Modified files:
    .               : ChangeLog
    plugins/elements: gstfilesrc.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4174&r2=1.4175
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfilesrc.c.diff?r1=1.167&r2=1.168

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4174
retrieving revision 1.4175
diff -u -d -r1.4174 -r1.4175
--- ChangeLog	24 Nov 2008 09:59:04 -0000	1.4174
+++ ChangeLog	24 Nov 2008 11:56:41 -0000	1.4175
@@ -1,3 +1,8 @@
+2008-11-24  Edward Hervey  <[email protected]>
+
+	* plugins/elements/gstfilesrc.c: (gst_file_src_uri_set_uri):
+	Fix memory leak.
 2008-11-24  Sebastian Dröge  <[email protected]>
 
 	Patch by: Simon Holm Thøgersen <odie at cs dot aau dot dk>
Index: gstfilesrc.c
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfilesrc.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- gstfilesrc.c	21 Nov 2008 18:26:14 -0000	1.167
+++ gstfilesrc.c	24 Nov 2008 11:56:44 -0000	1.168
@@ -1101,7 +1101,7 @@
 gst_file_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
 {
   gchar *location, *hostname = NULL;
-  gboolean ret;
+  gboolean ret = FALSE;
   GstFileSrc *src = GST_FILE_SRC (handler);
   if (strcmp (uri, "file://") == 0) {
@@ -1116,17 +1116,13 @@
   if (!location) {
     GST_WARNING_OBJECT (src, "Invalid URI '%s' for filesrc", uri);
-    return FALSE;
+    goto beach;
   }
-  if (hostname) {
-    if (strcmp (hostname, "localhost")) {
-      /* Only 'localhost' is permitted */
-      GST_WARNING_OBJECT (src, "Invalid hostname '%s' for filesrc", hostname);
-      g_free (hostname);
-      return FALSE;
-    }
-    g_free (hostname);
+  if ((hostname) && (strcmp (hostname, "localhost"))) {
+    /* Only 'localhost' is permitted */
+    GST_WARNING_OBJECT (src, "Invalid hostname '%s' for filesrc", hostname);
 #ifdef G_OS_WIN32
   /* Unfortunately, g_filename_from_uri() doesn't handle some UNC paths
@@ -1139,7 +1135,12 @@
 #endif
   ret = gst_file_src_set_location (src, location);
-  g_free (location);
+beach:
+  if (location)
+    g_free (location);
+  if (hostname)
+    g_free (hostname);
   return ret;
 }

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.