tweaks: plug a leak, by always freeing the full filename [valgrind]
parent
18659f3485
commit
c0c4a1b2b5
|
@ -2463,6 +2463,8 @@ char **filename_completion(const char *buf, size_t length, size_t *num_matches)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(fullname);
|
||||||
|
|
||||||
matches = (char **)nrealloc(matches, (*num_matches + 1) * sizeof(char *));
|
matches = (char **)nrealloc(matches, (*num_matches + 1) * sizeof(char *));
|
||||||
matches[*num_matches] = copy_of(entry->d_name);
|
matches[*num_matches] = copy_of(entry->d_name);
|
||||||
++(*num_matches);
|
++(*num_matches);
|
||||||
|
|
Loading…
Reference in New Issue