diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2023-02-28 03:22:13 -0600 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2023-02-28 03:22:13 -0600 |
commit | c99a4180d9ab1b9e2bd2fc6b3a0a77e6ed592939 (patch) | |
tree | fa34ed908e296df87e29ec588c83f639e59f0b70 /libpurple/protocols | |
parent | b807ad7ab6affadbf190666914be9fedf6ecc8f9 (diff) | |
download | pidgin-c99a4180d9ab1b9e2bd2fc6b3a0a77e6ed592939.tar.gz |
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/
Diffstat (limited to 'libpurple/protocols')
-rw-r--r-- | libpurple/protocols/demo/purpledemocontacts.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libpurple/protocols/demo/purpledemocontacts.c b/libpurple/protocols/demo/purpledemocontacts.c index 0f247955d2..07ad1a9fd5 100644 --- a/libpurple/protocols/demo/purpledemocontacts.c +++ b/libpurple/protocols/demo/purpledemocontacts.c @@ -252,4 +252,5 @@ purple_demo_contacts_load(PurpleAccount *account) { g_clear_object(&parser); g_input_stream_close(istream, NULL, NULL); + g_object_unref(istream); } |