From: Roy Marples Date: Fri, 12 Feb 2016 19:45:35 +0000 (+0000) Subject: fclose the pointer if chmod fails, fixes [b434b7f79e] X-Git-Tag: v6.10.2~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5722542c95b811151ebe012aa27df72d8e75e17;p=thirdparty%2Fdhcpcd.git fclose the pointer if chmod fails, fixes [b434b7f79e] --- 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;