projects
/
project
/
ubus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libubus: do not register/unregister with uloop during sync requests
[project/ubus.git]
/
examples
/
client.c
diff --git
a/examples/client.c
b/examples/client.c
index
b586eaf
..
7ef5663
100644
(file)
--- a/
examples/client.c
+++ b/
examples/client.c
@@
-106,8
+106,10
@@
static void test_count(struct uloop_timeout *timeout)
count_to += count_progression;
s = count_to_number(count_to);
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);
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));
fprintf(stderr, "Sending count up to '%u'; string has length '%u'\n",
count_to, (uint32_t)strlen(s));
@@
-116,6
+118,7
@@
static void test_count(struct uloop_timeout *timeout)
blobmsg_add_string(&b, "string", s);
if (ubus_lookup_id(ctx, "test", &id)) {
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;
}
fprintf(stderr, "Failed to look up test object\n");
return;
}