diff options
author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-26 01:11:22 +0000 |
---|---|---|
committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-26 01:11:22 +0000 |
commit | 3b123ca197c15a792a862666b79bc12507d1d571 (patch) | |
tree | cb725990abc4488fc45f375f09dd796c562a1036 /lasso/Attic | |
parent | ec8c3ce68c8ad21554a6191c6dea0f330050c3ba (diff) | |
download | lasso-3b123ca197c15a792a862666b79bc12507d1d571.tar.gz lasso-3b123ca197c15a792a862666b79bc12507d1d571.tar.xz lasso-3b123ca197c15a792a862666b79bc12507d1d571.zip |
Removed many memory leaks
Diffstat (limited to 'lasso/Attic')
-rw-r--r-- | lasso/Attic/protocols/identity.c | 5 | ||||
-rw-r--r-- | lasso/Attic/protocols/provider.c | 20 |
2 files changed, 16 insertions, 9 deletions
diff --git a/lasso/Attic/protocols/identity.c b/lasso/Attic/protocols/identity.c index 6efaea39..8ed7db73 100644 --- a/lasso/Attic/protocols/identity.c +++ b/lasso/Attic/protocols/identity.c @@ -139,6 +139,7 @@ lasso_identity_verify_nameIdentifier(LassoIdentity *identity, if(identity->local_nameIdentifier){ identity_content = lasso_node_get_content(identity->local_nameIdentifier); if(xmlStrEqual(identity_content, nameIdentifier_content)){ + xmlFree(identity_content); return(TRUE); } xmlFree(identity_content); @@ -146,6 +147,7 @@ lasso_identity_verify_nameIdentifier(LassoIdentity *identity, if(identity->remote_nameIdentifier){ identity_content = lasso_node_get_content(identity->remote_nameIdentifier); if(xmlStrEqual(identity_content, nameIdentifier_content)){ + xmlFree(identity_content); return(TRUE); } xmlFree(identity_content); @@ -182,8 +184,7 @@ lasso_identity_finalize(LassoIdentity *identity) debug("Identity object 0x%x finalized ...\n", identity); g_free(identity->remote_providerID); - - g_free (identity->private); + g_free(identity->private); parent_class->finalize(G_OBJECT(identity)); } diff --git a/lasso/Attic/protocols/provider.c b/lasso/Attic/protocols/provider.c index 4ab76dc3..d20cbe52 100644 --- a/lasso/Attic/protocols/provider.c +++ b/lasso/Attic/protocols/provider.c @@ -57,14 +57,15 @@ lasso_provider_dump(LassoProvider *provider) provider_class = LASSO_NODE_GET_CLASS(provider_node); provider_class->set_name(provider_node, LASSO_PROVIDER_NODE); provider_class->add_child(provider_node, metadata_node, FALSE); - if(provider->public_key) + lasso_node_destroy(metadata_node); + if(provider->public_key != NULL) { provider_class->set_prop(provider_node, LASSO_PROVIDER_PUBLIC_KEY_NODE, provider->public_key); - if(provider->ca_certificate) + } + if(provider->ca_certificate != NULL) { provider_class->set_prop(provider_node, LASSO_PROVIDER_CA_CERTIFICATE_NODE, provider->ca_certificate); - + } provider_dump = lasso_node_export(provider_node); - lasso_node_destroy(metadata_node); lasso_node_destroy(provider_node); return(provider_dump); @@ -235,11 +236,16 @@ static gchar *lasso_provider_get_direct_child_content(LassoProvider *provider, const gchar *name) { LassoNode *node; - + xmlChar *content; + node = lasso_node_get_child(LASSO_NODE(provider), name, NULL); - if(!node) + if(node == NULL) { return(NULL); - return(lasso_node_get_content(node)); + } + content = lasso_node_get_content(node); + lasso_node_destroy(node); + + return(content); } /*****************************************************************************/ |