ubus: Fix issues reported by static code analysis tool Klocwork
[project/ubus.git] / examples / client.c
index b586eaffd1605f337b1e3f490c219fa2a5850505..952ab549453abbcf803d7eef9070d11cfd4c4d82 100644 (file)
@@ -106,8 +106,10 @@ static void test_count(struct uloop_timeout *timeout)
        count_to += count_progression;
 
        s = count_to_number(count_to);
-       if (!s)
+       if (!s) {
                fprintf(stderr, "Could not allocate memory to count up to '%u'\n", count_to);
+               return;
+       }
 
        fprintf(stderr, "Sending count up to '%u'; string has length '%u'\n",
                count_to, (uint32_t)strlen(s));