Commit 55664c7e authored by Michael Tremer's avatar Michael Tremer

database: Free mmapped countries section

This was a potential memory leak.
Reported-by: default avatarGisle Vanem <gisle.vanem@gmail.com>
Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 2d87a81c
......@@ -446,6 +446,13 @@ static void loc_database_free(struct loc_database* db) {
ERROR(db->ctx, "Could not unmap network nodes section: %s\n", strerror(errno));
}
// Remove mapped countries section
if (db->countries_v1) {
r = munmap(db->countries_v1, db->countries_count * sizeof(*db->countries_v1));
if (r)
ERROR(db->ctx, "Could not unmap countries section: %s\n", strerror(errno));
}
if (db->pool)
loc_stringpool_unref(db->pool);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment