dir_scan: Avoid allocating new copies of buf_dir

This allocation is currently leaked, but as long as we don't allocate
new ones for each refresh, that shouldn't be much of an issue.
This commit is contained in:
Martin Storsjö 2019-02-18 12:00:55 +02:00
parent b6ddd491b3
commit 9dc2d32a8f

View file

@ -312,6 +312,7 @@ void dir_scan_init(const char *path) {
dir_setlasterr(NULL);
dir_seterr(NULL);
dir_process = process;
if (!buf_dir)
buf_dir = malloc(dir_memsize(""));
pstate = ST_CALC;
}