fix leak
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10261 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
2432ba1785
commit
78541e1ddb
|
@ -359,7 +359,8 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odb
|
||||||
char **names;
|
char **names;
|
||||||
char **vals;
|
char **vals;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
int done = 0;
|
||||||
|
|
||||||
if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) {
|
if (!(result = SQLFetch(stmt)) == SQL_SUCCESS) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -385,7 +386,7 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odb
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback(pdata, y, vals, names)) {
|
if (callback(pdata, y, vals, names)) {
|
||||||
break;
|
done = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x = 0; x < y; x++) {
|
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(names);
|
||||||
free(vals);
|
free(vals);
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
|
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
|
||||||
|
|
Loading…
Reference in New Issue