diff --git a/lzw.c b/lzw.c
index 995a9856c44a68d9abcc3fbb6bf8651e39597d8e..dc5deca0bb0b6708450821c0397d11bf32bde567 100644
--- a/lzw.c
+++ b/lzw.c
@@ -290,7 +290,7 @@ act_lzwdata(const HParseResult *p, void *u)
 void init_LZW_parser()
 {
 	context = malloc(sizeof(LZW_context_T));
-	memset(context, 0, sizeof(*context));
+	assert(context != NULL);
 	context->next = 258;
 	/* set up literals in LZW code table */
 	for(int i = 0; i < 256; i++)