handle error message leaks and other error conditions, Found by Klockwork (www.klocwork.com)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8440 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-05-16 16:43:47 +00:00
parent 41510454a8
commit fd63a52706
2 changed files with 19 additions and 10 deletions

View File

@@ -96,6 +96,10 @@ SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db, const char *sql, s
if (errmsg) {
*errmsg = err;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR [%s]\n", err);
switch_core_db_free(err);
err = NULL;
}
return ret;