git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10261 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-11-06 00:09:44 +00:00
parent 2432ba1785
commit 78541e1ddb
1 changed files with 7 additions and 2 deletions

View File

@ -359,7 +359,8 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odb
char **names;
char **vals;
int y = 0;
int done = 0;
if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) {
break;
}
@ -385,7 +386,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odb
}
if (callback(pdata, y, vals, names)) {
break;
done = 1;
}
for (x = 0; x < y; x++) {
@ -394,6 +395,10 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odb
}
free(names);
free(vals);
if (done) {
break;
}
}
SQLFreeHandle(SQL_HANDLE_STMT, stmt);