1
0
Fork 0

Fix a use-after-free ASan spotted.

This commit is contained in:
James Turner 2020-08-17 16:05:20 +01:00
parent 09067eecda
commit 06a14b4b27

View file

@ -2252,7 +2252,8 @@ NavDataCache::findAirportRunway(const std::string& aName)
AirportRunwayPair result;
sqlite_bind_stdstring(d->findAirportRunway, 1, parts[0]);
sqlite_bind_stdstring(d->findAirportRunway, 2, cleanRunwayNo(parts[1]));
const auto cleanedRunway = cleanRunwayNo(parts[1]);
sqlite_bind_stdstring(d->findAirportRunway, 2, cleanedRunway);
if (d->execSelect(d->findAirportRunway)) {
result = AirportRunwayPair(sqlite3_column_int64(d->findAirportRunway, 0),