]> git.meshlink.io Git - meshlink/commitdiff
Fix a filedescriptor leak.
authorGuus Sliepen <guus@sliepen.org>
Wed, 14 May 2014 21:06:23 +0000 (23:06 +0200)
committerGuus Sliepen <guus@sliepen.org>
Wed, 14 May 2014 21:06:23 +0000 (23:06 +0200)
Found by cppcheck.

src/meshlink.c

index c88059b1e02fe0be95777a15d10a1848d9d16ec8..62eda6da39703dbbadcbad1aa1c35f04fee8d6e1 100644 (file)
@@ -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;
        }