diff options
-rw-r--r-- | bindings/java/wrapper_top.c | 3 | ||||
-rw-r--r-- | bindings/php4/lasso_php4_helper.c | 3 | ||||
-rw-r--r-- | bindings/php5/wrapper_source_top.c | 3 | ||||
-rw-r--r-- | bindings/python/wrapper_top.c | 3 | ||||
-rw-r--r-- | lasso/id-ff/identity.c | 4 | ||||
-rw-r--r-- | lasso/id-ff/lecp.c | 3 | ||||
-rw-r--r-- | lasso/id-ff/login.c | 3 | ||||
-rw-r--r-- | lasso/id-ff/logout.c | 3 | ||||
-rw-r--r-- | lasso/id-ff/name_registration.c | 3 | ||||
-rw-r--r-- | lasso/id-ff/profile.c | 3 | ||||
-rw-r--r-- | lasso/id-ff/provider.c | 16 | ||||
-rw-r--r-- | lasso/id-ff/server.c | 4 | ||||
-rw-r--r-- | lasso/id-ff/session.c | 4 | ||||
-rw-r--r-- | lasso/id-wsf-2.0/data_service.c | 7 | ||||
-rw-r--r-- | lasso/id-wsf/data_service.c | 8 | ||||
-rw-r--r-- | lasso/id-wsf/discovery.c | 3 | ||||
-rw-r--r-- | lasso/id-wsf/wsf_profile.c | 6 | ||||
-rw-r--r-- | lasso/saml-2.0/ecp.c | 5 | ||||
-rw-r--r-- | lasso/saml-2.0/login.c | 6 | ||||
-rw-r--r-- | lasso/saml-2.0/name_id_management.c | 3 | ||||
-rw-r--r-- | lasso/xml/tools.c | 5 | ||||
-rw-r--r-- | lasso/xml/xml.c | 10 | ||||
-rw-r--r-- | swig/Lasso.i | 8 |
23 files changed, 67 insertions, 49 deletions
diff --git a/bindings/java/wrapper_top.c b/bindings/java/wrapper_top.c index 5c7d6907..c27ca23e 100644 --- a/bindings/java/wrapper_top.c +++ b/bindings/java/wrapper_top.c @@ -6,6 +6,7 @@ #include "com_entrouvert_lasso_LassoJNI.h" #include <string.h> #include "../ghashtable.h" +#include "../../lasso/utils.h" #define LASSO_ROOT "com/entrouvert/lasso/" #define check_exception (*env)->ExceptionCheck(env) @@ -337,7 +338,7 @@ jstring_to_xml_node(JNIEnv *env, jstring jstr, xmlNode **xmlnode) { out: *xmlnode = node; if (doc) - xmlFreeDoc(doc); + lasso_release_doc(doc); if (jstr && local_str) release_local_string(env, jstr, local_str); return ret; diff --git a/bindings/php4/lasso_php4_helper.c b/bindings/php4/lasso_php4_helper.c index 6bdc3bb2..bf4f2893 100644 --- a/bindings/php4/lasso_php4_helper.c +++ b/bindings/php4/lasso_php4_helper.c @@ -6,6 +6,7 @@ #undef PACKAGE_VERSION #include <lasso/lasso.h> #include "php_lasso.h" +#include "../../lasso/utils.h" /* utility functions */ static void free_glist(GList **list, GFunc free_function); @@ -149,7 +150,7 @@ get_xml_node_from_string(char *string) if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); return node; } diff --git a/bindings/php5/wrapper_source_top.c b/bindings/php5/wrapper_source_top.c index c8d9eee1..8969408b 100644 --- a/bindings/php5/wrapper_source_top.c +++ b/bindings/php5/wrapper_source_top.c @@ -7,6 +7,7 @@ #include <lasso/lasso.h> #include "php_lasso.h" #include "../ghashtable.h" +#include "../../lasso/utils.h" /* utility functions */ static void free_glist(GList **list, GFunc free_function); @@ -133,7 +134,7 @@ get_xml_node_from_string(char *string) if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); return node; } diff --git a/bindings/python/wrapper_top.c b/bindings/python/wrapper_top.c index b40c39f5..cb704aaa 100644 --- a/bindings/python/wrapper_top.c +++ b/bindings/python/wrapper_top.c @@ -4,6 +4,7 @@ #include <config.h> #include "../ghashtable.h" #include "../../lasso/debug.h" +#include "../../lasso/utils.h" GQuark lasso_wrapper_key; @@ -254,7 +255,7 @@ get_xml_node_from_pystring(PyObject *string) { if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); return node; } diff --git a/lasso/id-ff/identity.c b/lasso/id-ff/identity.c index b9022e1d..855399f3 100644 --- a/lasso/id-ff/identity.c +++ b/lasso/id-ff/identity.c @@ -528,12 +528,12 @@ lasso_identity_new_from_dump(const gchar *dump) rootElement = xmlDocGetRootElement(doc); if (strcmp((char*)rootElement->name, "Identity") != 0) { - xmlFreeDoc(doc); + lasso_release_doc(doc); return NULL; } identity = lasso_identity_new(); init_from_xml(LASSO_NODE(identity), rootElement); - xmlFreeDoc(doc); + lasso_release_doc(doc); return identity; } diff --git a/lasso/id-ff/lecp.c b/lasso/id-ff/lecp.c index 53eb5c96..502e3d4d 100644 --- a/lasso/id-ff/lecp.c +++ b/lasso/id-ff/lecp.c @@ -33,6 +33,7 @@ #include <lasso/id-ff/lecp.h> #include <lasso/id-ff/profileprivate.h> +#include "../utils.h" /*****************************************************************************/ /* public methods */ @@ -324,7 +325,7 @@ lasso_lecp_process_authn_request_envelope_msg(LassoLecp *lecp, const char *reque authn_request = xmlCopyNode(xpathObj->nodesetval->nodeTab[0], 1); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); - xmlFreeDoc(doc); + lasso_release_doc(doc); xpathCtx = NULL; xpathObj = NULL; doc = NULL; diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c index 44f2048e..7d30d6b7 100644 --- a/lasso/id-ff/login.c +++ b/lasso/id-ff/login.c @@ -173,6 +173,7 @@ #include <lasso/id-ff/loginprivate.h> #include <lasso/saml-2.0/loginprivate.h> +#include "../utils.h" static void lasso_login_build_assertion_artifact(LassoLogin *login); @@ -2168,7 +2169,7 @@ lasso_login_new_from_dump(LassoServer *server, const gchar *dump) doc = xmlParseMemory(dump, strlen(dump)); init_from_xml(LASSO_NODE(login), xmlDocGetRootElement(doc)); LASSO_PROFILE(login)->server = g_object_ref(server); - xmlFreeDoc(doc); + lasso_release_doc(doc); return login; } diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c index 89520824..4a76c1a9 100644 --- a/lasso/id-ff/logout.c +++ b/lasso/id-ff/logout.c @@ -38,6 +38,7 @@ #include <lasso/id-ff/sessionprivate.h> #include <lasso/saml-2.0/logoutprivate.h> +#include "../utils.h" static void check_soap_support(gchar *key, LassoProvider *provider, LassoProfile *profile); @@ -1155,7 +1156,7 @@ lasso_logout_new_from_dump(LassoServer *server, const char *dump) logout = lasso_logout_new(g_object_ref(server)); doc = xmlParseMemory(dump, strlen(dump)); init_from_xml(LASSO_NODE(logout), xmlDocGetRootElement(doc)); - xmlFreeDoc(doc); + lasso_release_doc(doc); return logout; } diff --git a/lasso/id-ff/name_registration.c b/lasso/id-ff/name_registration.c index b9846879..f2329c13 100644 --- a/lasso/id-ff/name_registration.c +++ b/lasso/id-ff/name_registration.c @@ -31,6 +31,7 @@ #include <lasso/id-ff/name_registration.h> #include <lasso/id-ff/profileprivate.h> #include <lasso/id-ff/providerprivate.h> +#include "../utils.h" /*****************************************************************************/ /* public methods */ @@ -759,7 +760,7 @@ lasso_name_registration_new_from_dump(LassoServer *server, const char *dump) name_registration = lasso_name_registration_new(server); doc = xmlParseMemory(dump, strlen(dump)); init_from_xml(LASSO_NODE(name_registration), xmlDocGetRootElement(doc)); - xmlFreeDoc(doc); + lasso_release_doc(doc); return name_registration; } diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index 71887259..23ee3c50 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -41,6 +41,7 @@ #include <lasso/id-ff/providerprivate.h> #include <lasso/saml-2.0/profileprivate.h> +#include "../utils.h" /*****************************************************************************/ /* public functions */ @@ -166,7 +167,7 @@ lasso_profile_get_request_type_from_soap_msg(const gchar *soap) xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); - xmlFreeDoc(doc); + lasso_release_doc(doc); return type; } diff --git a/lasso/id-ff/provider.c b/lasso/id-ff/provider.c index 015737b2..c06d8cc1 100644 --- a/lasso/id-ff/provider.c +++ b/lasso/id-ff/provider.c @@ -1057,7 +1057,7 @@ lasso_provider_new_from_dump(const gchar *dump) provider = g_object_new(LASSO_TYPE_PROVIDER, NULL); doc = xmlParseMemory(dump, strlen(dump)); init_from_xml(LASSO_NODE(provider), xmlDocGetRootElement(doc)); - xmlFreeDoc(doc); + lasso_release_doc(doc); return provider; } @@ -1120,7 +1120,7 @@ lasso_provider_verify_signature(LassoProvider *provider, xmlnode = xpathObj->nodesetval->nodeTab[0]; } if (xmlnode == NULL) { - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); return LASSO_PROFILE_ERROR_INVALID_MSG; @@ -1153,7 +1153,7 @@ lasso_provider_verify_signature(LassoProvider *provider, if (sign == NULL) { - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); return LASSO_DS_ERROR_SIGNATURE_NOT_FOUND; @@ -1173,7 +1173,7 @@ lasso_provider_verify_signature(LassoProvider *provider, keys_mngr = lasso_load_certs_from_pem_certs_chain_file( provider->ca_cert_chain); if (keys_mngr == NULL) { - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); return LASSO_DS_ERROR_CA_CERT_CHAIN_LOAD_FAILED; @@ -1188,7 +1188,7 @@ lasso_provider_verify_signature(LassoProvider *provider, xmlSecDSigCtxDestroy(dsigCtx); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); - xmlFreeDoc(doc); + lasso_release_doc(doc); return LASSO_DS_ERROR_PUBLIC_KEY_LOAD_FAILED; } } @@ -1197,7 +1197,7 @@ lasso_provider_verify_signature(LassoProvider *provider, xmlSecDSigCtxDestroy(dsigCtx); if (keys_mngr) xmlSecKeysMngrDestroy(keys_mngr); - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); return LASSO_DS_ERROR_SIGNATURE_VERIFICATION_FAILED; @@ -1207,7 +1207,7 @@ lasso_provider_verify_signature(LassoProvider *provider, if (dsigCtx->status != xmlSecDSigStatusSucceeded) { xmlSecDSigCtxDestroy(dsigCtx); - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); return LASSO_DS_ERROR_INVALID_SIGNATURE; @@ -1216,7 +1216,7 @@ lasso_provider_verify_signature(LassoProvider *provider, xmlSecDSigCtxDestroy(dsigCtx); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); - xmlFreeDoc(doc); + lasso_release_doc(doc); return 0; } diff --git a/lasso/id-ff/server.c b/lasso/id-ff/server.c index 04569291..16d9da9a 100644 --- a/lasso/id-ff/server.c +++ b/lasso/id-ff/server.c @@ -325,7 +325,7 @@ lasso_server_load_affiliation(LassoServer *server, const gchar *filename) node = xmlDocGetRootElement(doc); if (node == NULL || node->ns == NULL) { - xmlFreeDoc(doc); + lasso_release_doc(doc); return LASSO_XML_ERROR_NODE_NOT_FOUND; } @@ -336,7 +336,7 @@ lasso_server_load_affiliation(LassoServer *server, const gchar *filename) rc = LASSO_ERROR_UNIMPLEMENTED; } - xmlFreeDoc(doc); + lasso_release_doc(doc); return rc; } diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index b5d6c8e1..1428a685 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -856,13 +856,13 @@ lasso_session_new_from_dump(const gchar *dump) rootElement = xmlDocGetRootElement(doc); if (strcmp((char*)rootElement->name, "Session") != 0) { - xmlFreeDoc(doc); + lasso_release_doc(doc); return NULL; } session = lasso_session_new(); init_from_xml(LASSO_NODE(session), rootElement); - xmlFreeDoc(doc); + lasso_release_doc(doc); return session; } diff --git a/lasso/id-wsf-2.0/data_service.c b/lasso/id-wsf-2.0/data_service.c index 411e43ed..2323c4e5 100644 --- a/lasso/id-wsf-2.0/data_service.c +++ b/lasso/id-wsf-2.0/data_service.c @@ -39,6 +39,7 @@ #include <lasso/xml/id-wsf-2.0/dstref_modify_response.h> #include <lasso/xml/soap_fault.h> +#include "../utils.h" struct _LassoIdWsf2DataServicePrivate { @@ -284,7 +285,7 @@ lasso_idwsf2_data_service_parse_query_items(LassoIdWsf2DataService *service) /* Free XML parsing objects */ xmlUnlinkNode(service->data); xmlXPathFreeContext(xpathCtx); - xmlFreeDoc(doc); + lasso_release_doc(doc); response2 = LASSO_IDWSF2_UTIL_RESPONSE(response); response2->Status = lasso_idwsf2_util_status_new(); @@ -618,7 +619,7 @@ static void set_xml_string(xmlNode **xmlnode, const char* string) if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); if (*xmlnode) { xmlFreeNode(*xmlnode); @@ -811,7 +812,7 @@ lasso_idwsf2_data_service_parse_modify_items(LassoIdWsf2DataService *service) /* Free XML parsing objects */ xmlXPathFreeContext(cur_xpathCtx); - xmlFreeDoc(cur_doc); + lasso_release_doc(cur_doc); return res; } diff --git a/lasso/id-wsf/data_service.c b/lasso/id-wsf/data_service.c index c2d404ad..ba3ef677 100644 --- a/lasso/id-wsf/data_service.c +++ b/lasso/id-wsf/data_service.c @@ -285,7 +285,7 @@ lasso_data_service_process_query_msg(LassoDataService *service, const char *mess } query = LASSO_DST_QUERY(envelope->Body->any->data); service_type = g_strdup(query->hrefServiceType); - xmlFreeDoc(doc); + lasso_release_doc(doc); profile = LASSO_WSF_PROFILE(service); rc = lasso_wsf_profile_process_soap_request_msg(profile, message, service_type, @@ -394,7 +394,7 @@ lasso_data_service_build_response_msg(LassoDataService *service) xmlUnlinkNode(service->resource_data); xmlXPathFreeContext(xpathCtx); - xmlFreeDoc(doc); + lasso_release_doc(doc); return lasso_wsf_profile_build_soap_response_msg(profile); } @@ -793,7 +793,7 @@ lasso_data_service_build_modify_response_msg(LassoDataService *service) xmlXPathFreeContext(xpathCtx); g_list_foreach(node_to_free, (GFunc)xmlFreeNode, NULL); - xmlFreeDoc(doc); + lasso_release_doc(doc); lasso_release_list(node_to_free); return lasso_wsf_profile_build_soap_response_msg(profile); @@ -824,7 +824,7 @@ lasso_data_service_process_modify_msg(LassoDataService *service, modify = LASSO_DST_MODIFY(envelope->Body->any->data); service_type = g_strdup(modify->hrefServiceType); - xmlFreeDoc(doc); + lasso_release_doc(doc); profile = LASSO_WSF_PROFILE(service); rc = lasso_wsf_profile_process_soap_request_msg(profile, modify_soap_msg, service_type, diff --git a/lasso/id-wsf/discovery.c b/lasso/id-wsf/discovery.c index e31bc12c..507dccaa 100644 --- a/lasso/id-wsf/discovery.c +++ b/lasso/id-wsf/discovery.c @@ -85,6 +85,7 @@ #include <lasso/id-wsf/personal_profile_service.h> #include <lasso/id-wsf/wsf_profile_private.h> #include <lasso/id-wsf/utils.h> +#include "../utils.h" struct _LassoDiscoveryPrivate { @@ -1179,7 +1180,7 @@ lasso_discovery_build_key_info_node(LassoDiscovery *discovery, const gchar *prov key_info->KeyValue = key_value; xmlXPathFreeContext(xpathCtx); - xmlFreeDoc(doc); + lasso_release_doc(doc); return key_info; } diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c index 46e68e49..3e8768c1 100644 --- a/lasso/id-wsf/wsf_profile.c +++ b/lasso/id-wsf/wsf_profile.c @@ -733,7 +733,7 @@ lasso_wsf_profile_build_soap_response_msg(LassoWsfProfile *profile) profile->msg_body = g_strdup( (char*)(buf->conv ? buf->conv->content : buf->buffer->content)); xmlOutputBufferClose(buf); - xmlFreeDoc(doc); + lasso_release_doc(doc); return 0; } @@ -798,7 +798,7 @@ exit: lasso_release_gobject(envelope); } if (doc) { - xmlFreeDoc(doc); + lasso_release_doc(doc); } return rc; @@ -871,7 +871,7 @@ exit: lasso_release_gobject(envelope); } if (doc) { - xmlFreeDoc(doc); + lasso_release_doc(doc); } return rc; } diff --git a/lasso/saml-2.0/ecp.c b/lasso/saml-2.0/ecp.c index e74da802..1d343f8b 100644 --- a/lasso/saml-2.0/ecp.c +++ b/lasso/saml-2.0/ecp.c @@ -40,6 +40,7 @@ #include <lasso/saml-2.0/ecpprivate.h> #include <lasso/saml-2.0/ecp.h> +#include "../utils.h" /*****************************************************************************/ /* public methods */ @@ -174,7 +175,7 @@ lasso_ecp_process_authn_request_msg(LassoEcp *ecp, const char *authn_request_msg LASSO_PROFILE(ecp)->msg_body = g_strdup( (char*)(buf->conv ? buf->conv->content : buf->buffer->content)); xmlOutputBufferClose(buf); - xmlFreeDoc(doc); + lasso_release_doc(doc); profile->remote_providerID = lasso_server_get_first_providerID(profile->server); if (profile->remote_providerID == NULL) { @@ -277,7 +278,7 @@ lasso_ecp_process_response_msg(LassoEcp *ecp, const char *response_msg) (char*)(buf->conv ? buf->conv->content : buf->buffer->content)); xmlOutputBufferClose(buf); - xmlFreeDoc(doc); + lasso_release_doc(doc); return 0; } diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c index 25109166..44c6891a 100644 --- a/lasso/saml-2.0/login.c +++ b/lasso/saml-2.0/login.c @@ -63,6 +63,8 @@ #include <lasso/xml/id-wsf-2.0/sec_token.h> #endif +#include "../utils.h" + static int lasso_saml20_login_process_federation(LassoLogin *login, gboolean is_consent_obtained); static gboolean lasso_saml20_login_must_ask_for_consent_private(LassoLogin *login); static gint lasso_saml20_login_process_response_status_and_assertion(LassoLogin *login); @@ -1087,7 +1089,7 @@ lasso_saml20_login_process_paos_response_msg(LassoLogin *login, gchar *msg) xmlnode = xpathObj->nodesetval->nodeTab[0]; } if (xmlnode == NULL) { - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); return LASSO_PROFILE_ERROR_INVALID_MSG; @@ -1101,7 +1103,7 @@ lasso_saml20_login_process_paos_response_msg(LassoLogin *login, gchar *msg) } xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); - xmlFreeDoc(doc); + lasso_release_doc(doc); profile->response = response; profile->remote_providerID = g_strdup( diff --git a/lasso/saml-2.0/name_id_management.c b/lasso/saml-2.0/name_id_management.c index 005a9846..fe1ad0c0 100644 --- a/lasso/saml-2.0/name_id_management.c +++ b/lasso/saml-2.0/name_id_management.c @@ -30,6 +30,7 @@ #include <lasso/id-ff/identityprivate.h> #include <lasso/id-ff/serverprivate.h> #include <lasso/xml/xml_enc.h> +#include "../utils.h" /** * SECTION:name_id_management @@ -796,7 +797,7 @@ lasso_name_id_management_new_from_dump(LassoServer *server, const char *dump) name_id_management = lasso_name_id_management_new(g_object_ref(server)); doc = xmlParseMemory(dump, strlen(dump)); init_from_xml(LASSO_NODE(name_id_management), xmlDocGetRootElement(doc)); - xmlFreeDoc(doc); + lasso_release_doc(doc); return name_id_management; } diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index 606e15b9..07dbd9c0 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -47,6 +47,7 @@ #include <lasso/xml/saml-2.0/saml2_assertion.h> #include <unistd.h> #include "../debug.h" +#include "../utils.h" LassoNode* lasso_assertion_encrypt(LassoSaml2Assertion *assertion); static xmlSecKeyPtr lasso_get_public_key_from_private_key_file(const char *private_key_file); @@ -787,7 +788,7 @@ lasso_sign_node(xmlNode *xmlnode, const char *id_attr_name, const char *id_value /* memory leak since we don't free doc but it causes some little memory * corruption; probably caused by the direct manipulation of xmlnode * parent attribute. */ - xmlFreeDoc(doc); + lasso_release_doc(doc); #endif return 0; @@ -917,7 +918,7 @@ lasso_node_init_from_deflated_query_part(LassoNode *node, char *deflate_string) xmlFree(re); root = xmlDocGetRootElement(doc); lasso_node_init_from_xml(node, root); - xmlFreeDoc(doc); + lasso_release_doc(doc); return TRUE; } diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index f69573a4..3c80ee2d 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -205,7 +205,7 @@ lasso_xml_parse_memory(const char *buffer, int size) ret = ctxt->myDoc; } else { ret = NULL; - xmlFreeDoc(ctxt->myDoc); + lasso_release_doc(ctxt->myDoc); ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); @@ -864,7 +864,7 @@ cleanup: if (encCtx) { xmlSecEncCtxDestroy(encCtx); } - xmlFreeDoc(doc); + lasso_release_doc(doc); return decrypted_node; } @@ -1562,7 +1562,7 @@ lasso_node_new_from_dump(const char *dump) node = lasso_node_new_from_xmlNode(xmlDocGetRootElement(doc)); - xmlFreeDoc(doc); + lasso_release_doc(doc); return node; } @@ -1594,7 +1594,7 @@ lasso_node_new_from_soap(const char *soap) node = lasso_node_new_from_xmlNode(xmlnode); } - xmlFreeDoc(doc); + lasso_release_doc(doc); xmlXPathFreeContext(xpathCtx); xmlXPathFreeObject(xpathObj); @@ -1842,7 +1842,7 @@ lasso_node_init_from_message(LassoNode *node, const char *message) lasso_node_init_from_xml(node, root); xmlXPathFreeObject(xpathObj); xmlXPathFreeContext(xpathCtx); - xmlFreeDoc(doc); + lasso_release_doc(doc); if (xpathCtx) { /* this tests a pointer which has been freed, it works * but is not really elegant */ diff --git a/swig/Lasso.i b/swig/Lasso.i index c7c05ba5..d26ded14 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -71,6 +71,8 @@ #include <lasso/xml/disco_encrypted_resource_id.h> #endif +#include "../lasso/utils.h" + %} /* GLib types */ @@ -1488,7 +1490,7 @@ static xmlNode *get_string_xml(const char *string) { if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); return node; } @@ -1588,7 +1590,7 @@ static void set_xml_list(GList **xmlListPointer, GPtrArray *xmlArray) { if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); } *xmlListPointer = g_list_append(*xmlListPointer, node); } @@ -1605,7 +1607,7 @@ static void set_xml_string(xmlNode **xmlnode, const char* string) if (node != NULL) { node = xmlCopyNode(node, 1); } - xmlFreeDoc(doc); + lasso_release_doc(doc); if (*xmlnode) { xmlFreeNode(*xmlnode); |