From e2a41468452633a5b336056fa7bdaf16093340a4 Mon Sep 17 00:00:00 2001 From: SJ Date: Sun, 24 Jan 2016 15:26:29 +0100 Subject: [PATCH] store cleanup fix --- src/store.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/store.c b/src/store.c index 908a35c4..2a2781c8 100644 --- a/src/store.c +++ b/src/store.c @@ -61,9 +61,16 @@ int store_file(struct session_data *sdata, char *filename, int startpos, int len } if(len == 0){ - if(fstat(fd, &st)) return ret; + if(fstat(fd, &st)){ + close(fd); + return ret; + } + len = st.st_size; - if(len == 0) return 1; + if(len == 0){ + close(fd); + return 1; + } } gettimeofday(&tv1, &tz);