mirror of
https://github.com/fmang/opustags.git
synced 2025-01-15 12:43:17 +01:00
fix a memory leak in ot::read_comments
This commit is contained in:
parent
d09d7bd634
commit
8d287a8070
@ -194,10 +194,12 @@ ot::status ot::read_comments(FILE* input, std::list<std::string>& comments)
|
||||
}
|
||||
std::string utf8;
|
||||
ot::status rc = to_utf8(line, nread, utf8);
|
||||
if (rc == ot::st::ok)
|
||||
if (rc == ot::st::ok) {
|
||||
comments.emplace_back(std::move(utf8));
|
||||
else
|
||||
} else {
|
||||
free(line);
|
||||
return {ot::st::badly_encoded, "UTF-8 conversion error: " + rc.message};
|
||||
}
|
||||
}
|
||||
free(line);
|
||||
return ot::st::ok;
|
||||
|
Loading…
x
Reference in New Issue
Block a user