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.

(cherry picked from commit 9dc2d32a8f)
This commit is contained in:
Martin Storsjö 2019-02-18 12:00:55 +02:00 committed by Yorhel
parent 8e021a46ee
commit ec0de4afa8

View file

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