From: Guus Sliepen Date: Wed, 14 May 2014 21:06:23 +0000 (+0200) Subject: Fix a filedescriptor leak. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=02e5ceb9075f31d418726a3120efc876cf7925d9;p=meshlink Fix a filedescriptor leak. Found by cppcheck. --- diff --git a/src/meshlink.c b/src/meshlink.c index c88059b1..62eda6da 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -426,6 +426,7 @@ static bool finalize_join(meshlink_handle_t *mesh) { FILE *fh = fopen(filename, "w"); if(!fh) { fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno)); + fclose(f); return false; }