sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit 8c0926c59bc07c2a4f86bfa7ed7ae6179ba8d14c
parent 3c632e6df61e2df58aaa753eedaeda289e490c7e
Author: Quentin Rameau <quinq@fifth.space>
Date:   Thu, 22 Jun 2017 14:22:04 +0200

Free raw on error or empty read

Diffstat:
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);