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.
(cherry picked from commit 9dc2d32a8f)
This commit is contained in:
parent
8e021a46ee
commit
ec0de4afa8
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue