Revision: 2022
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2022&view=rev
Author:   jcsjcs
Date:     2008-06-28 19:41:02 -0700 (Sat, 28 Jun 2008)

Log Message:
-----------
        * src/display_photo.c: fix possible memory leak. Thanks to Mike
          Heffner.

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog
    gtkpod/trunk/src/display_photo.c

Modified: gtkpod/trunk/ChangeLog
===================================================================
--- gtkpod/trunk/ChangeLog      2008-06-28 09:43:09 UTC (rev 2021)
+++ gtkpod/trunk/ChangeLog      2008-06-29 02:41:02 UTC (rev 2022)
@@ -1,3 +1,8 @@
+2008-06-29 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+       * src/display_photo.c: fix possible memory leak. Thanks to Mike
+         Heffner.
+
 2008-06-28 Jorg Schuler <jcsjcs at users.sourceforge.net>
 
        * src/file_itunesdb.c

Modified: gtkpod/trunk/src/display_photo.c
===================================================================
--- gtkpod/trunk/src/display_photo.c    2008-06-28 09:43:09 UTC (rev 2021)
+++ gtkpod/trunk/src/display_photo.c    2008-06-29 02:41:02 UTC (rev 2022)
@@ -144,6 +144,9 @@
        g_return_if_fail (itdb);
 
        eitdb = itdb->userdata;
+       g_return_if_fail (eitdb);
+       g_return_if_fail (eitdb->photodb == NULL);
+
        mp = itdb_get_mountpoint (itdb);
        db = itdb_photodb_parse (mp, &error);
        if (db == NULL)
@@ -153,22 +156,19 @@
                if (error)
                {
                        gtkpod_warning (_("Error reading iPod photo database 
(%s).\n"), error->message);
-                       g_error_free (error);
-                       error = NULL;
                } else
                {
                        gtkpod_warning (_("Error reading iPod photo 
database.\n"));
                }
-               eitdb->photodb = NULL;
            }
-           return;
        }
-
+       if (error)
+       {
+           g_error_free (error);
+           error = NULL;
+       }
        /* Set the reference to the photo database */
        eitdb->photodb = db;
-       /*printf ("Reference to photo db successfully set\n");*/
-       
-       /* A photo database is */
 }
 
 /**


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to