mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
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:
parent
b6ddd491b3
commit
9dc2d32a8f
1 changed files with 2 additions and 1 deletions
|
|
@ -312,6 +312,7 @@ void dir_scan_init(const char *path) {
|
||||||
dir_setlasterr(NULL);
|
dir_setlasterr(NULL);
|
||||||
dir_seterr(NULL);
|
dir_seterr(NULL);
|
||||||
dir_process = process;
|
dir_process = process;
|
||||||
|
if (!buf_dir)
|
||||||
buf_dir = malloc(dir_memsize(""));
|
buf_dir = malloc(dir_memsize(""));
|
||||||
pstate = ST_CALC;
|
pstate = ST_CALC;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue