aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2012-11-08 20:15:56 +0100
committerDavid Sommerseth <davids@redhat.com>2012-11-08 20:40:17 +0100
commit2091fd6fccfff3c158099c70cd0038fca180b2b9 (patch)
treeaf3684fa124711922d1fb3225abec69fe173b27d /server
parent67d7ec0273d6d4a4234a12235cea564d85f5f991 (diff)
downloadrteval-2091fd6fccfff3c158099c70cd0038fca180b2b9.tar.gz
server/parser: Make sure the XSLT parameter array is always cleared before use
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/parser/xmlparser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/parser/xmlparser.c b/server/parser/xmlparser.c
index 2ba7288..059dd79 100644
--- a/server/parser/xmlparser.c
+++ b/server/parser/xmlparser.c
@@ -211,10 +211,12 @@ void init_xmlparser(dbhelper_func const * dbhelpers)
*/
xmlDoc *parseToSQLdata(LogContext *log, xsltStylesheet *xslt, xmlDoc *indata_d, parseParams *params) {
xmlDoc *result_d = NULL;
- char *xsltparams[10];
+ char **xsltparams = NULL;
unsigned int idx = 0, idx_table = 0, idx_submid = 0,
idx_syskey = 0, idx_rterid = 0, idx_repfname = 0;
+ xsltparams = calloc(10, sizeof(char *));
+
if( xmlparser_dbhelpers == NULL ) {
writelog(log, LOG_ERR, "Programming error: xmlparser is not initialised");
return NULL;
@@ -276,6 +278,7 @@ xmlDoc *parseToSQLdata(LogContext *log, xsltStylesheet *xslt, xmlDoc *indata_d,
free(xsltparams[idx_repfname]);
}
+ free(xsltparams);
return result_d;
}