tFree temporary path in downloaditem - sacc - sacc (saccomys): simple gopher client.
Log
Files
Refs
LICENSE
---
commit 97eaeb752ee3fd28ac14199692a5082e257ef10e
parent 4b108fa359dcfaa9750edd8733750edd3c088c82
Author: Quentin Rameau 
Date:   Tue, 11 Jul 2017 00:55:37 +0200

Free temporary path in downloaditem

Diffstat:
  sacc.c                              |       4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/sacc.c b/sacc.c
t@@ -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;