projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a073b2c
)
Fix a file descriptor leak when using an invitation.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 2 Sep 2017 19:52:44 +0000
(21:52 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 2 Sep 2017 19:52:44 +0000
(21:52 +0200)
Found by cppcheck.
src/invitation.c
patch
|
blob
|
history
diff --git
a/src/invitation.c
b/src/invitation.c
index
b10151f
..
0dfd9ea
100644
(file)
--- 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;
}