From: Frank Lichtenheld Date: Fri, 12 May 2023 15:50:23 +0000 (+0200) Subject: dco_linux: properly close dco version file X-Git-Tag: v2.7_alpha1~471 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf496476b364f8613bacd48e10d6a1bbbf0aceda;p=thirdparty%2Fopenvpn.git dco_linux: properly close dco version file Since we only call this once, it is not a bad leak, but still. Change-Id: Id85766738c3ece4f2d1860f7d101e4446a894aed Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Message-Id: <20230512155023.444406-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26650.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 41540c0f8..796e6f25d 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -1020,6 +1020,7 @@ dco_version_string(struct gc_arena *gc) if (!fgets(BSTR(&out), BCAP(&out), fp)) { + fclose(fp); return "ERR"; } @@ -1031,6 +1032,7 @@ dco_version_string(struct gc_arena *gc) *nl = '\0'; } + fclose(fp); return BSTR(&out); }