summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2017-06-27 17:09:53 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2017-06-27 17:09:53 +0200
commit9596b20a82b631323bc06e85bbf6d94509336fa4 (patch)
tree314804f9936737f9616e4318bde67daf9b6d92b1
parent4aa51f14725cb4a57065400c31038b8a7cf9b826 (diff)
downloadglibmm-9596b20a82b631323bc06e85bbf6d94509336fa4.tar.gz
Gio::TlsDatabase: Fix memory leak in a vfunc
create_certificate_handle_vfunc() shall delete the returned character array after it has been copied to a Glib::ustring, or else it leaks memory. Bug 783360
-rw-r--r--gio/src/tlsdatabase.hg2
1 files changed, 2 insertions, 0 deletions
diff --git a/gio/src/tlsdatabase.hg b/gio/src/tlsdatabase.hg
index 85fdba18..1cabc18a 100644
--- a/gio/src/tlsdatabase.hg
+++ b/gio/src/tlsdatabase.hg
@@ -99,7 +99,9 @@ public:
_WRAP_VFUNC(TlsCertificateFlags verify_chain_finish(const Glib::RefPtr<AsyncResult>& result), "verify_chain_finish", errthrow)
+dnl// create_certificate_handle_vfunc() shall return a newly allocated string.
#m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
+#m4 _CONVERSION(`gchar*',`Glib::ustring',`Glib::convert_return_gchar_ptr_to_ustring($3)')
_WRAP_VFUNC(Glib::ustring create_certificate_handle(const Glib::RefPtr<const TlsCertificate>& certificate) const, "create_certificate_handle")
#m4 _CONVERSION(`Glib::RefPtr<TlsCertificate>',`GTlsCertificate*',`G_TLS_CERTIFICATE(g_object_ref(Glib::unwrap($3)))')