summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-02-12 19:45:35 +0000
committerRoy Marples <roy@marples.name>2016-02-12 19:45:35 +0000
commite5722542c95b811151ebe012aa27df72d8e75e17 (patch)
tree1a8e913869a40acfe3978b8aae906c202a0ceb06 /ipv6.c
parent56d0a93b1a3c83ca74baa12d557c404ec995e12b (diff)
downloaddhcpcd-e5722542c95b811151ebe012aa27df72d8e75e17.tar.xz
fclose the pointer if chmod fails, fixes [b434b7f79e]
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ipv6.c b/ipv6.c
index 170b9dca..5c5f93e9 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -251,6 +251,8 @@ ipv6_readsecret(struct dhcpcd_ctx *ctx)
eexit:
logger(ctx, LOG_ERR, "error writing secret: %s: %m", SECRET);
+ if (fp != NULL)
+ fclose(fp);
unlink(SECRET);
ctx->secret_len = 0;
return -1;