summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-03-16 13:43:16 +0100
committerDaniel Borkmann <dborkman@redhat.com>2013-03-16 13:43:16 +0100
commitc69b4960fa4f48fcc7bd320bc34e4fc8de613bdc (patch)
tree0416dff0bb17c4fdbbc789bbed7243f957e8a213
parent30e1aafbae487e63a1f1f294391bbdc993808c4b (diff)
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 <dborkman@redhat.com>
-rw-r--r--geoip.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/geoip.c b/geoip.c
index 2eff817..9d2e82c 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;