pidgin/pidgin

Fix leaks when loading accounts

15 months ago, Elliott Sales de Andrade
08966165974c
Fix leaks when loading accounts

Fix two leaks in account parser:
```
512 bytes in 4 blocks are definitely lost in loss record 30,342 of 33,863
at 0x484378A: malloc (vg_replace_malloc.c:392)
by 0x484870B: realloc (vg_replace_malloc.c:1451)
by 0x498071F: g_realloc (gmem.c:201)
by 0x499A343: g_string_maybe_expand (gstring.c:92)
by 0x499A3BF: g_string_sized_new (gstring.c:116)
by 0x499A7AA: UnknownInlinedFun (gstring.c:176)
by 0x499A7AA: g_string_new_len (gstring.c:167)
by 0x4D577C6: purple_xmlnode_get_data (xmlnode.c:460)
by 0x4CCD5D8: parse_account (accounts.c:338)
by 0x4CCD98B: load_accounts (accounts.c:449)
by 0x4CCE234: purple_accounts_init (accounts.c:667)
by 0x4CE3AC2: purple_core_init (core.c:174)
by 0x48A380A: pidgin_application_startup (pidginapplication.c:820)

512 bytes in 4 blocks are definitely lost in loss record 30,343 of 33,863
at 0x484378A: malloc (vg_replace_malloc.c:392)
by 0x484870B: realloc (vg_replace_malloc.c:1451)
by 0x498071F: g_realloc (gmem.c:201)
by 0x499A343: g_string_maybe_expand (gstring.c:92)
by 0x499A3BF: g_string_sized_new (gstring.c:116)
by 0x499A7AA: UnknownInlinedFun (gstring.c:176)
by 0x499A7AA: g_string_new_len (gstring.c:167)
by 0x4D577C6: purple_xmlnode_get_data (xmlnode.c:460)
by 0x4CCD610: parse_account (accounts.c:343)
by 0x4CCD98B: load_accounts (accounts.c:449)
by 0x4CCE234: purple_accounts_init (accounts.c:667)
by 0x4CE3AC2: purple_core_init (core.c:174)
by 0x48A380A: pidgin_application_startup (pidginapplication.c:820)
```
and one in the demo protocol:
```
16,008 (56 direct, 15,952 indirect) bytes in 1 blocks are definitely lost in loss record 33,622 of 33,863
at 0x4DDF1EF: g_type_create_instance (gtype.c:1909)
by 0x4DC4C1F: g_object_new_internal (gobject.c:2228)
by 0x4DC6972: g_object_new_valist (gobject.c:2567)
by 0x4DC6FCC: g_object_new (gobject.c:2040)
by 0x57CF444: g_resource_open_stream (gresource.c:764)
by 0x1CAA54A2: purple_demo_contacts_load (purpledemocontacts.c:233)
by 0x1CAA4CD0: purple_demo_connection_connect (purpledemoconnection.c:43)
by 0x4CE1540: purple_connection_connect (connection.c:955)
by 0x4CC7F5E: purple_account_real_connect (account.c:179)
by 0x4CC85B0: no_password_cb (account.c:355)
by 0x49784C7: g_timeout_dispatch (gmain.c:5007)
by 0x4977CBE: UnknownInlinedFun (gmain.c:3444)
by 0x4977CBE: g_main_context_dispatch (gmain.c:4162)
```

Testing Done:
Ran in valgrind and confirmed above leaks were gone.

Reviewed at https://reviews.imfreedom.org/r/2299/
##############################################################################
# General Options
option('devenv-config-dir', type : 'string',
description : 'config directory for running a devenv (defaults to a subdirectory of buildroot)')
option('doc', type : 'boolean', value : false,
description : 'build documentation with gtk-doc')
option('extraversion', type : 'string',
description : 'extra version number to be displayed in Help->About and --help (for packagers)')
option('introspection', type : 'boolean', value : true,
description : 'build introspection data')
option('build-dependencies', type : 'boolean', value : false,
description : 'enable the use of subprojects to build missing dependencies.')
##############################################################################
# Libpurple Options
option('kwallet', type : 'feature',
description : 'enable KWallet support')
option('libsecret', type : 'feature',
description : 'enable libsecret support')
##############################################################################
# Protocol Plugins
option('avahi', type : 'feature',
description : 'compile with avahi (required for Bonjour support)')
option('dynamic-prpls', type : 'string', value: 'all',
description : 'specify which protocols to build dynamically')
option('libgadu', type : 'feature',
description : 'compile with libgadu (required for GaduGadu support)')
##############################################################################
# Pidgin Options
option('console-logging', type : 'boolean', value : false,
description : 'compile with console logging support')
option('gtkui', type : 'boolean', value : true,
description : 'compile with GTK+ user interface')
option('unity-integration', type : 'feature',
description : 'compile with support for unity integration plugin')
##############################################################################
# Finch Options
option('consoleui', type : 'boolean', value : true,
description : 'compile with console user interface')
option('x', type : 'boolean', value : true)