MINOR: ncbuf: missing malloc checks in standalone code
Some malloc resulsts were not checked in standalone ncbuf code.
As this is debug/test code, we don't need to explicitly handle memory
errors, we just add some BUG_ON() to ensure that memory is properly
allocated and prevent unexpected results.
This partially fixes issue GH #2130.
No backport needed.
diff --git a/src/ncbuf.c b/src/ncbuf.c
index a96cf59..e1452f1 100644
--- a/src/ncbuf.c
+++ b/src/ncbuf.c
@@ -810,9 +810,11 @@
enum ncb_ret ret;
data0 = malloc(bufsize);
+ BUG_ON(!data0);
memset(data0, 0xff, bufsize);
bufarea = malloc(bufsize);
+ BUG_ON(!bufarea);
fprintf(stderr, "running unit tests\n");