diff --git a/src/ncbmbuf.c b/src/ncbmbuf.c index 222737ea6..e642e3d21 100644 --- a/src/ncbmbuf.c +++ b/src/ncbmbuf.c @@ -370,6 +370,12 @@ void test_ncbmb(void) char *data = calloc(16384, 1); struct ncbmbuf buf; + if (!area || !data) { + free(area); + free(data); + return; + } + memset(data, 0x11, 16384); /* 7 bytes data // 1 byte bitmap (0xfe) */ @@ -543,6 +549,12 @@ void test_ngtcp2_crypto(void) char *data = calloc(16384, 1); struct ncbmbuf buf; + if (!area || !data) { + free(area); + free(data); + return; + } + memset(data, 0x11, 16384); buf = ncbmb_make(area, 16384, 0);