2007-02-23 [colin] 2.7.2cvs71
authorColin Leroy <colin@colino.net>
Fri, 23 Feb 2007 22:15:29 +0000 (22:15 +0000)
committerColin Leroy <colin@colino.net>
Fri, 23 Feb 2007 22:15:29 +0000 (22:15 +0000)
* src/addressbook.c
Fix a leak, check for a few improbable nulls

ChangeLog
PATCHSETS
configure.ac
src/addressbook.c

index 8b6c481..5d7b7e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-23 [colin]     2.7.2cvs71
+
+       * src/addressbook.c
+               Fix a leak, check for a few improbable nulls
+
 2007-02-23 [colin]     2.7.2cvs70
 
        * src/main.c
index 19e1156..8faa7eb 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.360 -r 1.382.2.361 src/compose.c;  ) > 2.7.2cvs68.patchset
 ( cvs diff -u -r 1.207.2.149 -r 1.207.2.150 src/folderview.c;  cvs diff -u -r 1.1.2.43 -r 1.1.2.44 src/imap_gtk.c;  ) > 2.7.2cvs69.patchset
 ( cvs diff -u -r 1.115.2.138 -r 1.115.2.139 src/main.c;  cvs diff -u -r 1.7.2.9 -r 1.7.2.10 src/main.h;  cvs diff -u -r 1.14.2.51 -r 1.14.2.52 src/plugins/trayicon/trayicon.c;  ) > 2.7.2cvs70.patchset
+( cvs diff -u -r 1.60.2.82 -r 1.60.2.83 src/addressbook.c;  ) > 2.7.2cvs71.patchset
index f99953f..4d142a4 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=70
+EXTRA_VERSION=71
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index f227e89..87b2183 100644 (file)
@@ -4750,6 +4750,9 @@ static void addressbook_peek_subfolder_exists_load_folder( ItemFolder *parentFol
        FolderInfo *fi;
        FolderPathMatch *nextmatch = NULL;
 
+       if (!parentFolder)
+               return;
+
        list = parentFolder->listFolder;
        while ( list ) {
                folder = list->data;
@@ -4779,6 +4782,7 @@ static void addressbook_peek_subfolder_exists_load_folder( ItemFolder *parentFol
 
                fi = addressbook_peek_subfolder_exists_create_folderinfo( fiParent->book, folder );
                addressbook_peek_subfolder_exists_load_folder( folder, fi, nextmatch );
+               g_free(fi);
                list = g_list_next( list );
        }
 }
@@ -4823,7 +4827,7 @@ gboolean addressbook_peek_folder_exists( gchar *folderpath,
        list = addrindex_get_interface_list( _addressIndex_ );
        while ( list && !folder_path_match.matched ) {
                AddressInterface *interface = list->data;
-               if ( interface->type == ADDR_IF_BOOK ) {
+               if ( interface && interface->type == ADDR_IF_BOOK ) {
                        nodeDS = interface->listSource;
                        while ( nodeDS && !folder_path_match.matched ) {
                                ds = nodeDS->data;
@@ -4837,7 +4841,8 @@ gboolean addressbook_peek_folder_exists( gchar *folderpath,
                                abf = ds->rawDataSource;
 
                                /* match book name */
-                               if ( strcmp(folder_path_match.folder_path[0], abf->fileName) == 0 ) {
+                               if ( abf && abf->fileName &&
+                                   strcmp(folder_path_match.folder_path[0], abf->fileName) == 0 ) {
 
                                        debug_print("matched book name '%s'\n", abf->fileName);
                                        folder_path_match.book = ds;
@@ -4859,6 +4864,7 @@ gboolean addressbook_peek_folder_exists( gchar *folderpath,
                                                folder_path_match.index = 1;
                                                /* this call will set folder_path_match.matched and folder_path_match.folder */
                                                addressbook_peek_subfolder_exists_load_folder( rootFolder, fi, &folder_path_match );
+                                               g_free(fi);
                                        }
                                }