changeset 18952:974d110cf7b1

- libpurple is now responsible for some cleanup and final deletion of a VerificationRequest
author William Ehlhardt <williamehlhardt@gmail.com>
date Tue, 26 Jun 2007 21:59:09 +0000
parents 11e88e451bfb
children 89b32569890c
files libpurple/certificate.c libpurple/certificate.h
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Tue Jun 26 19:49:33 2007 +0000
+++ b/libpurple/certificate.c	Tue Jun 26 21:59:09 2007 +0000
@@ -80,13 +80,17 @@
 
 	if (NULL == vrq) return;
 
-	/* TODO: Should I make it easier on the Verifier programmer and
-	   clean up some of vrq's internals here? */
-	
 	/* Fetch the Verifier responsible... */
 	vr = vrq->verifier;
 	/* ...and order it to KILL */
 	(vr->destroy_request)(vrq);
+
+	/* Now the internals have been cleaned up, so clean up the libpurple-
+	   created elements */
+	g_free(vrq->subject_name);
+	purple_certificate_destroy_list(vrq->cert_chain);
+
+	g_free(vrq);
 }
 
 
--- a/libpurple/certificate.h	Tue Jun 26 19:49:33 2007 +0000
+++ b/libpurple/certificate.h	Tue Jun 26 21:59:09 2007 +0000
@@ -190,6 +190,9 @@
 
 	/**
 	 * Destroy a completed Request under this Verifier
+	 * The function pointed to here is only responsible for cleaning up
+	 * whatever PurpleCertificateVerificationRequest::data points to.
+	 * It should not call free(vrq)
 	 *
 	 * @param vrq       Request to destroy
 	 */