diff options
author | Milan Crha <mcrha@redhat.com> | 2015-09-23 19:05:11 +0200 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2015-09-23 19:07:37 +0200 |
commit | cc954e375a1bea0cec28c0a608d2c80bdb173282 (patch) | |
tree | f84a8912269d7b763c4c50795fffcf503cb230e0 | |
parent | 1765be5703f4e129ecc5c821dbffac4e18d26e68 (diff) | |
download | evolution-data-server-cc954e375a1bea0cec28c0a608d2c80bdb173282.tar.gz |
Fix a reference leak from e-webdav-discover
The SoupMessage was never freed, which also holds a reference
on an ESource, through e_soup_ssl_trust_connect(), thus leaking
two objects at once.
-rw-r--r-- | libedataserver/e-webdav-discover.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libedataserver/e-webdav-discover.c b/libedataserver/e-webdav-discover.c index 0fc13bf41..0f9f73b55 100644 --- a/libedataserver/e-webdav-discover.c +++ b/libedataserver/e-webdav-discover.c @@ -843,8 +843,10 @@ e_webdav_discover_get_calendar_collection_details (SoupSession *session, soup_uri_free (soup_uri); doc = e_webdav_discover_parse_xml (message, "multistatus", out_certificate_pem, out_certificate_errors, error); - if (!doc) + if (!doc) { + g_clear_object (&message); return FALSE; + } xp_ctx = xmlXPathNewContext (doc); xmlXPathRegisterNs (xp_ctx, XC ("D"), XC (NS_WEBDAV)); @@ -872,6 +874,8 @@ e_webdav_discover_get_calendar_collection_details (SoupSession *session, xmlXPathFreeContext (xp_ctx); xmlFreeDoc (doc); + g_clear_object (&message); + return TRUE; } @@ -1240,8 +1244,10 @@ e_webdav_discover_get_addressbook_collection_details (SoupSession *session, soup_uri_free (soup_uri); doc = e_webdav_discover_parse_xml (message, "multistatus", out_certificate_pem, out_certificate_errors, error); - if (!doc) + if (!doc) { + g_clear_object (&message); return FALSE; + } xp_ctx = xmlXPathNewContext (doc); xmlXPathRegisterNs (xp_ctx, XC ("D"), XC (NS_WEBDAV)); @@ -1269,6 +1275,8 @@ e_webdav_discover_get_addressbook_collection_details (SoupSession *session, xmlXPathFreeContext (xp_ctx); xmlFreeDoc (doc); + g_clear_object (&message); + return TRUE; } |