summaryrefslogtreecommitdiff
path: root/inotail.c
diff options
context:
space:
mode:
Diffstat (limited to 'inotail.c')
-rw-r--r--inotail.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index fe36a45..35fdd82 100644
--- a/inotail.c
+++ b/inotail.c
@@ -707,7 +707,7 @@ ignore:
static int watch_files(struct file_struct *files, int n_files)
{
int ifd, i;
- char buf[n_files * INOTIFY_BUFLEN];
+ char *buf = emalloc(n_files * INOTIFY_BUFLEN);
ifd = inotify_init();
if (errno == ENOSYS) {
@@ -775,6 +775,7 @@ static int watch_files(struct file_struct *files, int n_files)
}
}
+ free(buf);
close(ifd);
return -1;