From 69c7286ea7ae03f80a0c0b15eb48cfdb17255ff9 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Mon, 15 Oct 2018 14:37:48 +0000 Subject: [PATCH] util.c: munmap takes a pointer, not a file descriptor. The first argument to munmap(2) should be a pointer to an mmap'ed region, not a file descriptor. Signed-off-by: Dan Cross --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 53c195f..d2d348f 100644 --- a/src/util.c +++ b/src/util.c @@ -66,7 +66,7 @@ stralloc file2stralloc(const char *path) { } stralloc sa = EMPTY_STRALLOC; stralloc_copyb(&sa, p, len); - munmap(fd, len); + munmap(p, len); close(fd); return sa;