Free temporary path in downloaditem - sacc - sacc(omys), simple console gopher client
(HTM) git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) LICENSE
---
(DIR) commit 97eaeb752ee3fd28ac14199692a5082e257ef10e
(DIR) parent 4b108fa359dcfaa9750edd8733750edd3c088c82
(HTM) Author: Quentin Rameau <quinq@fifth.space>
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(-)
---
(DIR) 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;