Enlightenment CVS committal

Author  : mekius
Project : e17
Module  : libs/efreet

Dir     : e17/libs/efreet/src/lib


Modified Files:
        efreet_mime.c 


Log Message:
Fixed almost all the leaks.  One minor one is still lingering that I can't 
quite figure out.

===================================================================
RCS file: /cvs/e/e17/libs/efreet/src/lib/efreet_mime.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- efreet_mime.c       3 Jul 2007 04:47:29 -0000       1.6
+++ efreet_mime.c       3 Jul 2007 05:46:54 -0000       1.7
@@ -690,7 +690,12 @@
         {
             if (buf[i] == '[')
             {
-                IF_FREE(entry);
+                if(entry)
+                {
+                    IF_FREE(entry->mask);
+                    IF_FREE(entry->value);
+                    FREE(entry);
+                }
                 
                 last_section = i;
                 i++;
@@ -753,7 +758,6 @@
                         break;
 
                     case VALUE:
-                        entry->value_len = 0;
                         if (efreet_mime_endianess == EFREET_ENDIAN_LITTLE)
                             entry->value_len = ntohs(buf[i + 1] << 8 | 
(short)(buf[i]));
                         else
@@ -839,22 +843,26 @@
                 if (mime)
                 {
                     Efreet_Mime_Magic *m;
-                    m = ecore_list_goto_last(magics);
                   
+                    IF_FREE_LIST(mime->entries);
+                    
+                    m = ecore_list_goto_last(magics);
                     if (m && !(strcmp(m->mime,mimetype)))
-                    {
-                        efreet_mime_magic_free(m);
-                        ecore_list_remove(magics);
-                    }
-                
-                    FREE(mime);
+                        ecore_list_remove_destroy(magics);
+                    
+                    IF_FREE(mime);
                 }
                 
                 /*
                  * If we finished in the middle of an entry, make sure to
                  * clean it up as well.
                  */
-                IF_FREE(entry);
+                if(entry)
+                {
+                    IF_FREE(entry->value);
+                    IF_FREE(entry->mask);
+                    IF_FREE(entry);
+                }
                 
                 fseek(f, last_section-4096, SEEK_CUR);
                 break;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to