more return code checking

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2016-01-20 17:01:47 +08:00
parent 40f4bc9c1c
commit 496e0af86e
2 changed files with 4 additions and 2 deletions

View file

@ -388,7 +388,8 @@ libwebsockets_get_addresses(struct libwebsocket_context *context,
if (addr4.sin_family == AF_UNSPEC)
return -1;
lws_plat_inet_ntop(AF_INET, &addr4.sin_addr, rip, rip_len);
if (lws_plat_inet_ntop(AF_INET, &addr4.sin_addr, rip, rip_len) == NULL)
return -1;
return 0;
}

View file

@ -281,7 +281,8 @@ int libwebsocket_parse(
case URIES_SEEN_PERCENT_H1:
if (char_to_hex(c) < 0) {
/* regurgitate */
issue_char(wsi, '%');
if (issue_char(wsi, '%') < 0)
return -1;
wsi->u.hdr.ues = URIES_IDLE;
/* regurgitate + assess */
if (libwebsocket_parse(context, wsi, wsi->u.hdr.esc_stash) < 0)