From 23632698216bb1e11e19fe87fab857120f956208 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Thu, 8 May 2014 11:10:42 -0400 Subject: [PATCH] mod_rayo: fix compiler error to nlsml.c from attempted coverity fix --- src/mod/event_handlers/mod_rayo/nlsml.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mod/event_handlers/mod_rayo/nlsml.c b/src/mod/event_handlers/mod_rayo/nlsml.c index e166742be8..9d9154d159 100644 --- a/src/mod/event_handlers/mod_rayo/nlsml.c +++ b/src/mod/event_handlers/mod_rayo/nlsml.c @@ -1,6 +1,6 @@ /* * mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2013, Grasshopper + * Copyright (C) 2013-2014, Grasshopper * * Version: MPL 1.1 * @@ -306,20 +306,20 @@ static int cdata_hook(void *user_data, char *data, size_t len) /** * Parse the result, looking for noinput/nomatch/match - * @param result the NLSML result to parse + * @param nlsml_result the NLSML result to parse * @param uuid optional UUID for logging * @return true if successful */ -enum nlsml_match_type nlsml_parse(const char *result, const char *uuid) +enum nlsml_match_type nlsml_parse(const char *nlsml_result, const char *uuid) { struct nlsml_parser parser = { 0 }; int result = NMT_BAD_XML; iksparser *p = NULL; parser.uuid = uuid; - if (!zstr(result)) { + if (!zstr(nlsml_result)) { p = iks_sax_new(&parser, tag_hook, cdata_hook); - if (iks_parse(p, result, 0, 1) == IKS_OK) { + if (iks_parse(p, nlsml_result, 0, 1) == IKS_OK) { /* check result */ if (parser.match) { result = NMT_MATCH; @@ -341,8 +341,10 @@ enum nlsml_match_type nlsml_parse(const char *result, const char *uuid) switch_log_printf(SWITCH_CHANNEL_UUID_LOG(parser.uuid), SWITCH_LOG_INFO, "Missing NLSML result\n"); } end: - if ( p ) + + if ( p ) { iks_parser_delete(p); + } return result; }