mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -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() {
|
int calc_process() {
|
||||||
char *path, *name;
|
char *path = NULL, *name = NULL;
|
||||||
struct stat fs;
|
struct stat fs;
|
||||||
struct dir *t;
|
struct dir *t;
|
||||||
int n;
|
int n;
|
||||||
|
|
@ -494,7 +494,7 @@ int calc_process() {
|
||||||
/* something went wrong... */
|
/* something went wrong... */
|
||||||
freedir(root);
|
freedir(root);
|
||||||
calc_fail:
|
calc_fail:
|
||||||
if(!path[1] && strcmp(name, "."))
|
if(name && path && !path[1] && strcmp(name, "."))
|
||||||
free(name);
|
free(name);
|
||||||
free(path);
|
free(path);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue