commit c0c4a1b2b52f5c3ac350164ee3478871ac53fc0a
parent 18659f3485e7ad5e456c3841b670ca90edcc0f33
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 26 Jun 2020 09:47:38 +0200
tweaks: plug a leak, by always freeing the full filename [valgrind]
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2463,6 +2463,8 @@ char **filename_completion(const char *buf, size_t length, size_t *num_matches)
continue;
}
+ free(fullname);
+
matches = (char **)nrealloc(matches, (*num_matches + 1) * sizeof(char *));
matches[*num_matches] = copy_of(entry->d_name);
++(*num_matches);