# HG changeset patch # User William Ehlhardt # Date 1186984502 0 # Node ID 7b81934f4c851074d510923a516183b8b8d1b363 # Parent 8926e15873ca22044fbf14225b1d38d40f70c797 - Implement x509_ca_delete_cert diff -r 8926e15873ca -r 7b81934f4c85 libpurple/certificate.c --- a/libpurple/certificate.c Mon Aug 13 05:52:21 2007 +0000 +++ b/libpurple/certificate.c Mon Aug 13 05:55:02 2007 +0000 @@ -804,20 +804,25 @@ static gboolean x509_ca_delete_cert(const gchar *id) { - gboolean ret = FALSE; - + x509_ca_element *el; + g_return_val_if_fail(x509_ca_lazy_init(), FALSE); g_return_val_if_fail(id, FALSE); /* Is the id even in the pool? */ - if (!x509_ca_cert_in_pool(id)) { + el = x509_ca_locate_cert(x509_ca_certs, id); + if ( el == NULL ) { purple_debug_warning("certificate/x509/ca", "Id %s wasn't in the pool\n", id); return FALSE; } - return ret; + /* Unlink it from the memory cache and destroy it */ + x509_ca_certs = g_list_remove(x509_ca_certs, el); + x509_ca_element_free(el); + + return TRUE; } static GList *