diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2007-01-05 11:40:10 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2007-01-05 11:40:10 +0000 |
commit | 41d6f7df6847f647744934dbdf72fa6cb4e37343 (patch) | |
tree | 4708c435d147e40e338ce4cf49c9a95a676d192a /lasso/id-wsf | |
parent | 38e9d703915cb7bdef983afbd35c4ab1898a7a6f (diff) | |
download | lasso-41d6f7df6847f647744934dbdf72fa6cb4e37343.tar.gz lasso-41d6f7df6847f647744934dbdf72fa6cb4e37343.tar.xz lasso-41d6f7df6847f647744934dbdf72fa6cb4e37343.zip |
memory management, avoid leaking xmlDoc*
Diffstat (limited to 'lasso/id-wsf')
-rw-r--r-- | lasso/id-wsf/data_service.c | 2 | ||||
-rw-r--r-- | lasso/id-wsf/wsf_profile.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lasso/id-wsf/data_service.c b/lasso/id-wsf/data_service.c index f4c07fd6..6d400ef8 100644 --- a/lasso/id-wsf/data_service.c +++ b/lasso/id-wsf/data_service.c @@ -340,6 +340,8 @@ lasso_data_service_process_query_msg(LassoDataService *service, const char *mess node_list; node_list = g_list_next(node_list)) { LassoNode *node = node_list->data; if (LASSO_IS_SOAP_BINDING_PROVIDER(node)) { + if (service->provider_id) + g_free(service->provider_id); service->provider_id = g_strdup( LASSO_SOAP_BINDING_PROVIDER(node)->providerID); } diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c index 6e07d934..2f17d933 100644 --- a/lasso/id-wsf/wsf_profile.c +++ b/lasso/id-wsf/wsf_profile.c @@ -1275,7 +1275,6 @@ lasso_wsf_profile_process_soap_request_msg(LassoWsfProfile *profile, const gchar } doc = xmlParseMemory(message, strlen(message)); - /* FIXME: doc will never be freed */ /* Verify authentication mecanisms */ if (lasso_wsf_profile_has_x509_authentication(profile) == TRUE) { @@ -1288,8 +1287,10 @@ lasso_wsf_profile_process_soap_request_msg(LassoWsfProfile *profile, const gchar if (res > 0) { fault = lasso_soap_fault_new(); fault->faultstring = g_strdup("Invalid signature"); - } else if (res < 0) + } else if (res < 0) { + xmlFreeDoc(doc); return res; + } /* FIXME: Remove Signature element if exists, it seg fault when a call to lasso_node_new_from_xmlNode() */ @@ -1322,6 +1323,8 @@ lasso_wsf_profile_process_soap_request_msg(LassoWsfProfile *profile, const gchar profile->private_data->fault = fault; } + xmlFreeDoc(doc); + return res; } |