tweaks: plug a leak, by always freeing the full filename [valgrind]

This commit is contained in:
Benno Schulenberg 2020-06-26 09:47:38 +02:00
parent 18659f3485
commit c0c4a1b2b5
1 changed files with 2 additions and 0 deletions

View File

@ -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);