From 96965948de16da000b29fcdc31c5af270b69bd1a Mon Sep 17 00:00:00 2001 From: Vishal Agarwal Date: Thu, 10 May 2012 19:13:47 +0530 Subject: [PATCH] textfile: fix missing call to munmap in wite_key In some cases it was possible that munmap is not called corresponding to mmap, which might result in future read or writes to fail. --- src/textfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textfile.c b/src/textfile.c index 2712cd85e..9d88fbc16 100644 --- a/src/textfile.c +++ b/src/textfile.c @@ -220,8 +220,8 @@ static int write_key(const char *pathname, const char *key, const char *value, i len = strlen(key); off = find_key(map, size, key, len, icase); if (!off) { + munmap(map, size); if (value) { - munmap(map, size); lseek(fd, size, SEEK_SET); err = write_key_value(fd, key, value); } -- 2.47.3