]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Set fp to NULL after fclose() to avoid a potential secondary fclose() if the
authorRoy Marples <roy@marples.name>
Tue, 16 Feb 2016 09:54:29 +0000 (09:54 +0000)
committerRoy Marples <roy@marples.name>
Tue, 16 Feb 2016 09:54:29 +0000 (09:54 +0000)
first call failed.
Fixes [a4c18d501a].

ipv6.c

diff --git a/ipv6.c b/ipv6.c
index 16f73ad51f4aafe58fa42ef3413ff01e53e134a4..f7451e40b48924f033ce68c53ac44fc561379920 100644 (file)
--- 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;