Fix CID 1491373 and 1491378: resource leaks.
authorwwp <subscript@free.fr>
Tue, 5 Oct 2021 11:08:39 +0000 (13:08 +0200)
committerwwp <subscript@free.fr>
Tue, 5 Oct 2021 11:08:39 +0000 (13:08 +0200)
src/addrbook.c

index 296af5d23a283caac89120bbdc0b139bf35fa437..7f31ed55d572ca887ab7cbe57421799b797824be 100644 (file)
@@ -630,7 +630,10 @@ static void addrbook_parse_group(AddressBookFile *book, XMLFile *file)
                        addrcache_hash_add_group(book->addressCache, group);
                }
                addrbook_parse_member_list(book, file, group);
-       }
+       } else {
+               if (group)
+                       addritem_free_item_group(group);
+       }    
 }
 
 /**
@@ -726,6 +729,9 @@ static void addrbook_parse_folder(AddressBookFile *book, XMLFile *file)
                        }
                }
                addrbook_parse_folder_list(book, file, folder);
+       } else {
+               if (folder)
+                       addritem_free_item_folder(folder);
        }
 }