From 07c7755f81bbc8759ede535f598f1f7921f54e93 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 16 Oct 2022 23:24:52 +0100 Subject: [PATCH] Fix Coverity Scan 1499806 --- test/lib/c/03-request-response-correlation-1.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/lib/c/03-request-response-correlation-1.c b/test/lib/c/03-request-response-correlation-1.c index fc67c315..7dde9a93 100644 --- a/test/lib/c/03-request-response-correlation-1.c +++ b/test/lib/c/03-request-response-correlation-1.c @@ -32,8 +32,10 @@ static void on_subscribe(struct mosquitto *mosq, void *obj, int mid, int qos_cou abort(); } - mosquitto_property_add_string(&props, MQTT_PROP_RESPONSE_TOPIC, "response/topic"); - mosquitto_property_add_binary(&props, MQTT_PROP_CORRELATION_DATA, "corridor", 8); + if(mosquitto_property_add_string(&props, MQTT_PROP_RESPONSE_TOPIC, "response/topic") + || mosquitto_property_add_binary(&props, MQTT_PROP_CORRELATION_DATA, "corridor", 8)){ + abort(); + } rc = mosquitto_publish_v5(mosq, NULL, "request/topic", 6, "action", QOS, 0, props); if(rc != MOSQ_ERR_SUCCESS){ abort();