From: Fredrik Tolf Date: Tue, 14 Jun 2011 19:25:27 +0000 (+0200) Subject: Fixed FD leak in fssrc. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=c0cebb1011f4bb907aa9edd0751fd95867cd1b84;p=statserve.git Fixed FD leak in fssrc. --- diff --git a/fssrc.c b/fssrc.c index 8a34ddb..c69da66 100644 --- a/fssrc.c +++ b/fssrc.c @@ -49,12 +49,14 @@ static struct fileinfo fsserve(struct source *src, char *nm) flog(LOG_ERR, "fssrc: %s: %s", p, strerror(errno)); free(p); buffree(rb); + close(fd); return((struct fileinfo){}); } if(ret == 0) break; rb.d += ret; } + close(fd); return((struct fileinfo){.mtime = sb.st_mtime, .sz = rb.d, .data = rb.b, .ctype = "image/png"}); }