aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/serd_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/serd_test.c b/tests/serd_test.c
index 9650dfc5..6fa4849b 100644
--- a/tests/serd_test.c
+++ b/tests/serd_test.c
@@ -244,7 +244,7 @@ static void
test_blob_to_node(void)
{
for (size_t size = 0; size < 256; ++size) {
- uint8_t* data = (uint8_t*)malloc(size);
+ uint8_t* data = size > 0 ? (uint8_t*)malloc(size) : NULL;
for (size_t i = 0; i < size; ++i) {
data[i] = (uint8_t)(rand() % 256);
}