Fix crash when LDAP address source is defined in index, but LDAP support is disabled
authorAndrej Kacian <ticho@local>
Wed, 16 Jan 2019 17:36:55 +0000 (18:36 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Wed, 16 Jan 2019 17:37:06 +0000 (18:37 +0100)
AddressIfFrag is being cast to AddrBookBase, so it too
needs to have the two mandatory members at the beginning.

src/addrindex.c

index 82c2fed..62d4aa9 100644 (file)
@@ -162,6 +162,8 @@ static gint addrindex_write_to                      ( AddressIndex *addrIndex,
  */
 typedef struct _AddressIfFrag AddressIfFragment;
 struct _AddressIfFrag {
+       AddressBookType type;
+       AddressCache *addressCache;
        gchar *name;
        GList *children;
        GList *attributes;
@@ -1013,6 +1015,8 @@ static AddressIfFragment *addrindex_read_fragment( XMLFile *file ) {
 
        /* Create new fragment */
        fragment = g_new0( AddressIfFragment, 1 );
+       fragment->type = ADBOOKTYPE_NONE;
+       fragment->addressCache = NULL;
        fragment->name = g_strdup( xtag->tag );
        fragment->children = NULL;
        fragment->attributes = NULL;