From: Roy Marples Date: Tue, 16 Feb 2016 09:54:29 +0000 (+0000) Subject: Set fp to NULL after fclose() to avoid a potential secondary fclose() if the X-Git-Tag: v6.10.2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce66b1e5ed45df99a8fb770fc2dbd8510a6fe921;p=thirdparty%2Fdhcpcd.git Set fp to NULL after fclose() to avoid a potential secondary fclose() if the first call failed. Fixes [a4c18d501a]. --- 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;