Skip to content
Snippets Groups Projects
Commit 12ddb3fa authored by Piotr Balcer's avatar Piotr Balcer
Browse files

examples: fix pmem2 redo example fd leak

parent 6c7e703d
No related branches found
No related tags found
No related merge requests found
......@@ -426,8 +426,10 @@ main(int argc, char *argv[])
struct pmem2_map *map = pool_map(fd, map_private);
if (map == NULL)
return 1;
if (map == NULL) {
ret = 1;
goto err_map;
}
size_t size = pmem2_map_get_size(map);
if (size < POOL_SIZE_MIN) {
......@@ -474,6 +476,7 @@ main(int argc, char *argv[])
}
out:
pmem2_unmap(&map);
err_map:
close(fd);
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment