Free temporary path in downloaditem - sacc - sacc(omys), simple console gopher … | |
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65… | |
Log | |
Files | |
Refs | |
Tags | |
LICENSE | |
--- | |
commit 97eaeb752ee3fd28ac14199692a5082e257ef10e | |
parent 4b108fa359dcfaa9750edd8733750edd3c088c82 | |
Author: Quentin Rameau <[email protected]> | |
Date: Tue, 11 Jul 2017 00:55:37 +0200 | |
Free temporary path in downloaditem | |
Diffstat: | |
M sacc.c | 4 +++- | |
1 file changed, 3 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/sacc.c b/sacc.c | |
@@ -342,7 +342,9 @@ downloaditem(Item *item) | |
path[strlen(path)-1] = '\0'; | |
- if ((dest = open(path, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) { | |
+ dest = open(path, O_WRONLY|O_CREAT|O_EXCL, mode); | |
+ free(path); | |
+ if (dest < 0) { | |
printf("Can't open destination file %s: %s\n", | |
path, strerror(errno)); | |
errno = 0; |