mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-01-02 20:42:14 +08:00
Fix mem leak in SQLGetData
Free temporary string when we are past result length and we return SQL_NO_DATA
This commit is contained in:
committed by
Nirgal Vourgère
parent
ee1978161c
commit
6326e54e82
@@ -1618,8 +1618,10 @@ static SQLRETURN SQL_API _SQLGetData(
|
|||||||
char *str = mdb_col_to_string(mdb, mdb->pg_buf,
|
char *str = mdb_col_to_string(mdb, mdb->pg_buf,
|
||||||
col->cur_value_start, col->col_type, col->cur_value_len);
|
col->cur_value_start, col->col_type, col->cur_value_len);
|
||||||
int len = strlen(str);
|
int len = strlen(str);
|
||||||
if (stmt->pos >= len)
|
if (stmt->pos >= len) {
|
||||||
|
free(str);
|
||||||
return SQL_NO_DATA;
|
return SQL_NO_DATA;
|
||||||
|
}
|
||||||
if (!cbValueMax) {
|
if (!cbValueMax) {
|
||||||
if (pcbValue)
|
if (pcbValue)
|
||||||
*pcbValue = len;
|
*pcbValue = len;
|
||||||
|
|||||||
Reference in New Issue
Block a user