diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-06-20 10:50:01 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-06-20 10:50:01 +0200 |
commit | b9848ce99f13bdf07ab5e538422d83280a6fe321 (patch) | |
tree | c191abd5cd14a8fbf3fd83e927d6afb74952272d /inotail.c | |
parent | b054120a5cde828bf2ca54d434dfb7f12ea0bf01 (diff) |
inotail.c: Add missing free() calls after lseek() failure
Diffstat (limited to 'inotail.c')
-rw-r--r-- | inotail.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -145,6 +145,7 @@ static off_t lines_to_offset_from_end(struct file_struct *f, unsigned long n_lin if (lseek(f->fd, offset, SEEK_SET) == (off_t) -1) { fprintf(stderr, "Error: Could not seek in file '%s' (%s)\n", f->name, strerror(errno)); + free(buf); return -1; } @@ -187,6 +188,7 @@ static off_t lines_to_offset_from_begin(struct file_struct *f, unsigned long n_l if (lseek(f->fd, offset, SEEK_SET) == (off_t) -1) { fprintf(stderr, "Error: Could not seek in file '%s' (%s)\n", f->name, strerror(errno)); + free(buf); return -1; } @@ -314,6 +316,7 @@ static int tail_file(struct file_struct *f, unsigned long n_units, char mode, ch if (lseek(f->fd, offset, SEEK_SET) == (off_t) -1) { fprintf(stderr, "Error: Could not seek in file '%s' (%s)\n", f->name, strerror(errno)); + free(buf); return -1; } |