Merged revisions 332830 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/10

................
  r332830 | rmudgett | 2011-08-22 13:32:09 -0500 (Mon, 22 Aug 2011) | 15 lines
  
  Merged revisions 332816 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r332816 | rmudgett | 2011-08-22 13:14:59 -0500 (Mon, 22 Aug 2011) | 8 lines
    
    Memory leaks in realtime_multi_xxx() when database access returns error.
    
    * Fix realtime_multi_pgsql() configuration memory leak when the database 
    access returns an error.  
    
    * Fix realtime_multi_odbc() configuration category use after free when the
    database access returns an error.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2011-08-22 18:33:27 +00:00
parent b8748f4c00
commit bac5a51e21
2 changed files with 10 additions and 3 deletions

View File

@@ -419,7 +419,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Describe Column error!\n[%s]\n\n", sql);
ast_category_destroy(cat);
continue;
goto next_sql_fetch;
}
indicator = 0;
@@ -430,7 +430,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
ast_category_destroy(cat);
continue;
goto next_sql_fetch;
}
stringp = rowdata;
while (stringp) {
@@ -448,6 +448,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
}
}
ast_category_append(cfg, cat);
next_sql_fetch:;
}
SQLFreeHandle(SQL_HANDLE_STMT, stmt);