summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2016-12-13 06:07:32 (GMT)
committersangwan.kwon <sangwan.kwon@samsung.com>2016-12-13 06:07:32 (GMT)
commitc8d86331b65b3c290e7a1b3de7092d3a5a00b468 (patch)
tree98b94b0ec7213bcf04eddb98aaa0dd4815662843
parent569d8600374c6e0b686443467a148987265668f7 (diff)
downloadxmlsec1-c8d86331b65b3c290e7a1b3de7092d3a5a00b468.zip
xmlsec1-c8d86331b65b3c290e7a1b3de7092d3a5a00b468.tar.gz
xmlsec1-c8d86331b65b3c290e7a1b3de7092d3a5a00b468.tar.bz2
Fix memory leak on custom coderefs/changes/26/104326/1
* The result of xmlGetProp() should be free. * See, http://xmlsoft.org/library.html Change-Id: Icf2741000f0bbb9e80747db86d395fedd5f44268 Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
-rw-r--r--src/xmldsig.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/xmldsig.c b/src/xmldsig.c
index 299ea57..8e156e2 100644
--- a/src/xmldsig.c
+++ b/src/xmldsig.c
@@ -986,10 +986,17 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
while(pc != NULL) {
if(strncmp(refUri, pc->cache, xmlStrlen(refUri)) == 0) {
isInProxy = 1;
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ NULL,
+ XMLSEC_ERRORS_MAX_NUMBER,
+ "[%s] is already checked by singature-validator.",
+ refUri);
break;
}
pc = pc->next;
}
+ xmlFree(refUri);
} else {
/* if proxy is not exist, process references */
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -999,15 +1006,8 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
"Proxy doesn't exist.");
}
- if(isInProxy) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- NULL,
- XMLSEC_ERRORS_MAX_NUMBER,
- "[%s] is already checked by singature-validator.",
- xmlGetProp(cur, xmlSecAttrURI));
+ if(isInProxy)
continue;
- }
}
/* TIZEN CUTUMIZED : check uri only in proxy caches for partial mode */
@@ -1015,7 +1015,6 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
int isInProxy = 0;
if(dsigCtx->checkReferences != NULL) {
-
xmlChar* refUri = xmlGetProp(cur, xmlSecAttrURI);
if(refUri == NULL) {
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -1031,10 +1030,17 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
while(pc != NULL) {
if(xmlSecDecodeCmp(refUri, pc->cache) == 0) {
isInProxy = 1;
+ xmlSecError(XMLSEC_ERRORS_HERE,
+ NULL,
+ NULL,
+ XMLSEC_ERRORS_MAX_NUMBER,
+ "Check [%s] on processing references.",
+ refUri);
break;
}
pc = pc->next;
}
+ xmlFree(refUri);
} else {
/* if proxy is not exist, process references */
xmlSecError(XMLSEC_ERRORS_HERE,
@@ -1045,15 +1051,8 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
}
/* if not exist on proxy, skip on processing references */
- if(isInProxy == 0) {
- xmlSecError(XMLSEC_ERRORS_HERE,
- NULL,
- NULL,
- XMLSEC_ERRORS_MAX_NUMBER,
- "Skip [%s] on processing references.",
- xmlGetProp(cur, xmlSecAttrURI));
+ if(isInProxy == 0)
continue;
- }
}
/* create reference */