ubus: Fix memleak in examples/client in case of failure
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 28 Apr 2015 14:07:28 +0000 (16:07 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 8 May 2015 10:06:39 +0000 (12:06 +0200)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
examples/client.c

index 952ab549453abbcf803d7eef9070d11cfd4c4d82..7ef566347e540f8d9e096552b8244f6cc3a0e5f5 100644 (file)
@@ -118,6 +118,7 @@ static void test_count(struct uloop_timeout *timeout)
        blobmsg_add_string(&b, "string", s);
 
        if (ubus_lookup_id(ctx, "test", &id)) {
+               free(s);
                fprintf(stderr, "Failed to look up test object\n");
                return;
        }