mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +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:
parent
ee1978161c
commit
6326e54e82
@ -1618,8 +1618,10 @@ static SQLRETURN SQL_API _SQLGetData(
|
||||
char *str = mdb_col_to_string(mdb, mdb->pg_buf,
|
||||
col->cur_value_start, col->col_type, col->cur_value_len);
|
||||
int len = strlen(str);
|
||||
if (stmt->pos >= len)
|
||||
if (stmt->pos >= len) {
|
||||
free(str);
|
||||
return SQL_NO_DATA;
|
||||
}
|
||||
if (!cbValueMax) {
|
||||
if (pcbValue)
|
||||
*pcbValue = len;
|
||||
|
Loading…
Reference in New Issue
Block a user