fix: fix memory leak in map_put

thanks dylan :)
This commit is contained in:
2023-12-08 05:11:01 +01:00
parent a76c093c9f
commit 2fe7b6a4d6
2 changed files with 10 additions and 5 deletions

View File

@@ -9,12 +9,15 @@
int main() {
Map *map = map_create();
map_put(map, 0x0, 1);
map_put(map, 0x10, 2);
for(int i = 0; i < 10000; i++) {
map_put(map, i, i + 1);
}
for(int i = 0; i < 10000; i++) {
assert(map_get(map, i) == i + 1);
}
// for(int i = 0; i < 10000; i++) {
// assert(map_get(map, i) == i + 1);
// }
map_free(map);
}