summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-02-16 09:54:29 +0000
committerRoy Marples <roy@marples.name>2016-02-16 09:54:29 +0000
commitce66b1e5ed45df99a8fb770fc2dbd8510a6fe921 (patch)
tree77f2b52b966f971def7a78c8c98f9fec60691a0f /ipv6.c
parent289562ab9452ca26d7da2053e1e8b47141823a5e (diff)
downloaddhcpcd-ce66b1e5ed45df99a8fb770fc2dbd8510a6fe921.tar.xz
Set fp to NULL after fclose() to avoid a potential secondary fclose() if the
first call failed. Fixes [a4c18d501a].
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ipv6.c b/ipv6.c
index 16f73ad5..f7451e40 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -228,6 +228,7 @@ ipv6_readsecret(struct dhcpcd_ctx *ctx)
hwaddr_ntoa(ctx->secret, ctx->secret_len, line, sizeof(line)));
if (fclose(fp) == EOF)
x = -1;
+ fp = NULL;
if (x > 0)
return (ssize_t)ctx->secret_len;