summaryrefslogtreecommitdiff
path: root/curvetun.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-09-07 17:24:56 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-09-07 17:24:56 +0200
commit047d69c4eb2cefe9bab654fb570592d3863da792 (patch)
tree1aa5a0957501bc6bf901af3843f265954b1ed966 /curvetun.c
parentf472d90b141d0e9f0c1033012d6d2be1338b7b1f (diff)
curvetun: Fix issues detected by the Coverity scanner
Fix two issues detected by the Coverity scanner (CID 991819 & CID 991822) Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'curvetun.c')
-rw-r--r--curvetun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/curvetun.c b/curvetun.c
index 52bfb44..7507a75 100644
--- a/curvetun.c
+++ b/curvetun.c
@@ -328,7 +328,7 @@ static void check_config_keypair_or_die(char *home)
if (fd < 0) {
err = EIO;
errstr = "Cannot open privkey file!\n";
- goto out;
+ goto out_noclose;
}
ret = read(fd, secretkey, sizeof(secretkey));
@@ -368,7 +368,7 @@ static void check_config_keypair_or_die(char *home)
}
out:
close(fd);
-
+out_noclose:
xmemset(publickey, 0, sizeof(publickey));
xmemset(publicres, 0, sizeof(publicres));
xmemset(secretkey, 0, sizeof(secretkey));