]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
fclose the pointer if chmod fails, fixes [b434b7f79e]
authorRoy Marples <roy@marples.name>
Fri, 12 Feb 2016 19:45:35 +0000 (19:45 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Feb 2016 19:45:35 +0000 (19:45 +0000)
ipv6.c

diff --git a/ipv6.c b/ipv6.c
index 170b9dca1028c7235ddd07d5d19624c946d58392..5c5f93e988ef02b577083ae2aeda7f184cd3f793 100644 (file)
--- 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;