From b7b988ed64dbb5566e6826d72b596cc090f4f822 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 13 Sep 2021 15:01:27 +0200 Subject: [PATCH] can: fix nullptr check --- lib/nodes/can.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes/can.cpp b/lib/nodes/can.cpp index 37a9f5c7d..2232b16e5 100644 --- a/lib/nodes/can.cpp +++ b/lib/nodes/can.cpp @@ -152,10 +152,10 @@ int can_parse(struct vnode *n, json_t *json) if (!c->in) throw MemoryAllocationError(); - c->out = (struct can_signal*)calloc( + c->out = (struct can_signal*) calloc( json_array_size(json_out_signals), sizeof(struct can_signal)); - if (c->out) + if (!c->out) throw MemoryAllocationError(); json_array_foreach(json_in_signals, i, json_signal) {