From: Guus Sliepen Date: Sat, 12 Jul 2014 12:34:39 +0000 (+0200) Subject: Fix a potential file descriptor leak. X-Git-Tag: release-1.1pre11~67 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=31361075d36fd3f4a393eeb90b75ae2567992ef2;p=tinc Fix a potential file descriptor leak. Found by cppcheck. --- diff --git a/src/invitation.c b/src/invitation.c index a6996cc6..28f9f8ce 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -613,6 +613,7 @@ make_names: FILE *fh = fopen(filename, "w"); if(!fh) { fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno)); + fclose(f); return false; }