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:
William Rogers 2013-06-14 12:36:20 -05:00 committed by Nirgal Vourgère
parent ee1978161c
commit 6326e54e82

View File

@ -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;