This was a potential memory leak.
Reported-by: Gisle Vanem <gisle.vanem@gmail.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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);