aboutsummaryrefslogtreecommitdiff
path: root/tests/proto.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-11 19:59:31 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-11 20:04:34 +0200
commitdf3f53bd5c370dcd46074189f3ad545c6aab942b (patch)
treebe27ba0d62132173f9bd0f9a2d5779792e92df65 /tests/proto.c
parente029aae1d3d1884ca868c3694bdec0456b3e8267 (diff)
downloadliberty-df3f53bd5c370dcd46074189f3ad545c6aab942b.tar.gz
liberty-df3f53bd5c370dcd46074189f3ad545c6aab942b.tar.xz
liberty-df3f53bd5c370dcd46074189f3ad545c6aab942b.zip
Add a basic fuzzing framework using libFuzzer
Updates #1
Diffstat (limited to 'tests/proto.c')
-rw-r--r--tests/proto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/proto.c b/tests/proto.c
index c0b6d49..27afe1c 100644
--- a/tests/proto.c
+++ b/tests/proto.c
@@ -77,7 +77,7 @@ test_irc (void)
static void
test_http_parser (void)
{
- struct str_map parameters = str_map_make (NULL);
+ struct str_map parameters = str_map_make (free);
parameters.key_xfrm = tolower_ascii_strxfrm;
char *type = NULL;
@@ -88,9 +88,11 @@ test_http_parser (void)
soft_assert (!strcasecmp_ascii (subtype, "html"));
soft_assert (parameters.len == 1);
soft_assert (!strcmp (str_map_find (&parameters, "charset"), "utf-8"));
+ free (type);
+ free (subtype);
str_map_free (&parameters);
- struct http_protocol *protocols;
+ struct http_protocol *protocols = NULL;
soft_assert (http_parse_upgrade ("websocket, HTTP/2.0, , ", &protocols));
soft_assert (!strcmp (protocols->name, "websocket"));