mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
399ccdeb caused a crash on non-existent directories on the command line
This commit is contained in:
parent
399ccdeb47
commit
0b49021a6c
1 changed files with 2 additions and 2 deletions
|
|
@ -367,7 +367,7 @@ int calc_key(int ch) {
|
|||
|
||||
|
||||
int calc_process() {
|
||||
char *path, *name;
|
||||
char *path = NULL, *name = NULL;
|
||||
struct stat fs;
|
||||
struct dir *t;
|
||||
int n;
|
||||
|
|
@ -494,7 +494,7 @@ int calc_process() {
|
|||
/* something went wrong... */
|
||||
freedir(root);
|
||||
calc_fail:
|
||||
if(!path[1] && strcmp(name, "."))
|
||||
if(name && path && !path[1] && strcmp(name, "."))
|
||||
free(name);
|
||||
free(path);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue