From 393183dccc4d100366972bdbbdc6e03a77839120 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Mon, 26 May 2003 14:07:50 +0000 Subject: Vodz, last_patch_86 --- libbb/isdirectory.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'libbb/isdirectory.c') diff --git a/libbb/isdirectory.c b/libbb/isdirectory.c index e8ef2df14..e9b106aa3 100644 --- a/libbb/isdirectory.c +++ b/libbb/isdirectory.c @@ -20,8 +20,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include #include #include "libbb.h" @@ -32,11 +30,11 @@ int is_directory(const char *fileName, const int followLinks, struct stat *statBuf) { int status; - int didMalloc = 0; + struct stat astatBuf; if (statBuf == NULL) { - statBuf = (struct stat *)xmalloc(sizeof(struct stat)); - ++didMalloc; + /* set from auto stack buffer */ + statBuf = &astatBuf; } if (followLinks) @@ -49,10 +47,6 @@ int is_directory(const char *fileName, const int followLinks, struct stat *statB } else status = TRUE; - if (didMalloc) { - free(statBuf); - statBuf = NULL; - } return status; } -- cgit v1.2.3