diff options
-rw-r--r-- | lasso/xml/tools.c | 13 | ||||
-rw-r--r-- | lasso/xml/xml.c | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c index af33702a..6e6e7aba 100644 --- a/lasso/xml/tools.c +++ b/lasso/xml/tools.c @@ -363,6 +363,7 @@ lasso_load_certs_from_pem_certs_chain_file(const char* pem_certs_chain_file) } g_io_channel_shutdown(gioc, TRUE, NULL); + g_io_channel_unref(gioc); return keys_mngr; } @@ -800,16 +801,11 @@ lasso_sign_node(xmlNode *xmlnode, const char *id_attr_name, const char *id_value return critical_error(LASSO_DS_ERROR_SIGNATURE_FAILED); } xmlSecDSigCtxDestroy(dsig_ctx); - xmlUnlinkNode(xmlnode); xmlRemoveID(doc, id_attr); - - xmlnode->parent = old_parent; -#if 0 - /* 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. */ + xmlUnlinkNode(xmlnode); lasso_release_doc(doc); -#endif + xmlnode->parent = old_parent; + xmlSetTreeDoc(xmlnode, NULL); return 0; } @@ -1091,6 +1087,7 @@ exit: lasso_release_signature_context(dsigCtx); if (free_the_doc) { xmlUnlinkNode(signed_node); + xmlSetTreeDoc(signed_node, NULL); lasso_release_doc(doc); } lasso_release_string(id); diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 580f1fad..40242be3 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -1120,6 +1120,7 @@ lasso_node_impl_get_xmlNode(LassoNode *node, gboolean lasso_dump) xmlNewNs(xmlnode, ns->href, ns->prefix); t = g_list_next(t); } + g_list_free(list_ns); xmlSetNs(xmlnode, xmlnode->nsDef); @@ -1130,6 +1131,7 @@ lasso_node_impl_get_xmlNode(LassoNode *node, gboolean lasso_dump) class->node_data->snippets, lasso_dump); t = g_list_previous(t); } + g_list_free(list_classes); xmlCleanNs(xmlnode); |