[Freeswitch-svn] [commit] r8452 - freeswitch/trunk/src/mod/applications/mod_commands
Freeswitch SVN
mikej at freeswitch.org
Fri May 16 14:54:44 EDT 2008
Author: mikej
Date: Fri May 16 14:54:43 2008
New Revision: 8452
Modified:
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
Log:
don't leak db error string. Found by Klockwork (www.klocwork.com)
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Fri May 16 14:54:43 2008
@@ -2025,6 +2025,12 @@
} else if (!strcasecmp(as, "xml")) {
switch_core_db_exec(db, sql, show_as_xml_callback, &holder, &errmsg);
+ if (errmsg) {
+ stream->write_function(stream, "-ERR SQL Error [%s]\n", errmsg);
+ switch_core_db_free(errmsg);
+ errmsg = NULL;
+ }
+
if (holder.xml) {
char count[50];
char *xmlstr;
More information about the Freeswitch-svn
mailing list