diff options
Diffstat (limited to 'extension/readdir.c')
-rw-r--r-- | extension/readdir.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/extension/readdir.c b/extension/readdir.c index 91296801..7bcabcb0 100644 --- a/extension/readdir.c +++ b/extension/readdir.c @@ -10,7 +10,7 @@ */ /* - * Copyright (C) 2012, 2013 the Free Software Foundation, Inc. + * Copyright (C) 2012-2014 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -67,6 +67,10 @@ #define _(msgid) gettext(msgid) #define N_(msgid) msgid +#ifndef PATH_MAX +#define PATH_MAX 1024 /* a good guess */ +#endif + static const gawk_api_t *api; /* for convenience macros to work */ static awk_ext_id_t *ext_id; static const char *ext_version = "readdir extension: version 1.0"; @@ -235,8 +239,8 @@ dir_close(awk_input_buf_t *iobuf) the_dir = (open_directory_t *) iobuf->opaque; closedir(the_dir->dp); - free(the_dir->buf); - free(the_dir); + gawk_free(the_dir->buf); + gawk_free(the_dir); iobuf->fd = -1; } |