From: Bastian Dehn Date: Sat, 28 Feb 2026 14:39:57 +0000 (+0100) Subject: is dir no malloc X-Git-Tag: 1.1.5^2~1 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=c5fdf0c377d556f787aafc4ece046defd5050d5d;p=mv_none_space.git is dir no malloc --- diff --git a/src/main.c b/src/main.c index a33ca0a..6516cd0 100644 --- a/src/main.c +++ b/src/main.c @@ -22,13 +22,10 @@ glob_t* get_files(const char* dir_path) bool is_dir(const char* path) { - struct stat* statbuf = malloc(sizeof(struct stat)); + struct stat statbuf; - stat(path, statbuf); - bool isdir = S_ISDIR(statbuf->st_mode); - - free(statbuf); - statbuf = NULL; + stat(path, &statbuf); + bool isdir = S_ISDIR(statbuf.st_mode); return isdir; }