From: Guus Sliepen Date: Sat, 2 Sep 2017 19:52:44 +0000 (+0200) Subject: Fix a file descriptor leak when using an invitation. X-Git-Tag: release-1.1pre15~3 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=00d81ee6236e76f80b84372ac5c635636ad48136;p=tinc Fix a file descriptor leak when using an invitation. Found by cppcheck. --- diff --git a/src/invitation.c b/src/invitation.c index b10151f0..0dfd9eac 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -611,6 +611,8 @@ make_names: FILE *finv = fopen(filename, "w"); if(!finv || fwrite(data, datalen, 1, finv) != 1) { fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno)); + fclose(fh); + fclose(f); fclose(finv); return false; }