Free raw on error or empty read - sacc - sacc(omys), simple console gopher clie… | |
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65… | |
Log | |
Files | |
Refs | |
Tags | |
LICENSE | |
--- | |
commit 8c0926c59bc07c2a4f86bfa7ed7ae6179ba8d14c | |
parent 3c632e6df61e2df58aaa753eedaeda289e490c7e | |
Author: Quentin Rameau <[email protected]> | |
Date: Thu, 22 Jun 2017 14:22:04 +0200 | |
Free raw on error or empty read | |
Diffstat: | |
M sacc.c | 5 ++++- | |
1 file changed, 4 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/sacc.c b/sacc.c | |
@@ -306,8 +306,11 @@ dig(Item *entry, Item *item) | |
sendselector(sock, item->selector); | |
item->raw = getrawitem(sock); | |
- if (!*item->raw) /* empty read */ | |
+ if (!*item->raw) { /* empty read */ | |
+ free(item->raw); | |
+ item->raw = NULL; | |
return 0; | |
+ } | |
if (item->type == '1') | |
item->dir = molddiritem(item->raw); |