summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lasso/xml/xml.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c
index 9ca9207e..e370ba96 100644
--- a/lasso/xml/xml.c
+++ b/lasso/xml/xml.c
@@ -1406,8 +1406,7 @@ lasso_node_impl_add_signature_tmpl(LassoNode *node,
}
if (reference_uri != NULL) {
- uri = xmlMalloc(strlen(reference_uri)+1+1);
- g_sprintf(uri, "#%s", reference_uri);
+ uri = g_strdup_printf("#%s", reference_uri);
}
else {
uri = NULL;
@@ -1415,6 +1414,7 @@ lasso_node_impl_add_signature_tmpl(LassoNode *node,
reference = xmlSecTmplSignatureAddReference(signature,
xmlSecTransformSha1Id,
NULL, uri, NULL);
+ g_free(uri);
if (reference == NULL) {
message(G_LOG_LEVEL_CRITICAL, "Failed to add reference to signature template\n");