sacc

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

commit 21f17b1b4f46148775147403b4057c148b44bbda
parent cdc79e9b37b3d104c7d50f7bff217c1dc5eb2f34
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 @@ -311,8 +311,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);