From c69b4960fa4f48fcc7bd320bc34e4fc8de613bdc Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Sat, 16 Mar 2013 13:43:16 +0100 Subject: [PATCH] geoip: reorder statements, so that file handles are closed first Coverty detected, when we are in an error condition, we do not close file handles, but just return instead. Thus, reorder statements, so that file handles are closed for sure. Signed-off-by: Daniel Borkmann --- geoip.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/geoip.c b/geoip.c index 2eff817a..9d2e82c7 100644 --- a/geoip.c +++ b/geoip.c @@ -236,16 +236,15 @@ again: printf("\n"); + close(fd); + close(sock); + if (totlen != rtotlen) { unlink(files[which].local); return -EIO; } - close(fd); - close(sock); - geoip_inflate(which); - unlink(zfile); return 0; -- 2.11.4.GIT