aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bindings/samples/hello3.c1
-rw-r--r--src/afb-wsj1.c6
-rw-r--r--src/sig-monitor.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/bindings/samples/hello3.c b/bindings/samples/hello3.c
index af194785..ff7da61a 100644
--- a/bindings/samples/hello3.c
+++ b/bindings/samples/hello3.c
@@ -913,6 +913,7 @@ static void api (afb_req_t request)
}
sapi->api = afb_api_new_api(api, apiname, NULL, 1, apipreinit, NULL);
if (!sapi->api) {
+ free(sapi);
afb_req_reply_f(request, NULL, "cant-create", "%m");
goto end;
}
diff --git a/src/afb-wsj1.c b/src/afb-wsj1.c
index 33e0d195..4080edf2 100644
--- a/src/afb-wsj1.c
+++ b/src/afb-wsj1.c
@@ -307,11 +307,13 @@ static struct afb_wsj1_msg *wsj1_msg_make(struct afb_wsj1 *wsj1, char *text, siz
/* scan */
n = wsj1_msg_scan(text, items);
- if (n < 0)
+ if (n <= 0)
goto bad_header;
/* scans code: 2|3|4|5 */
- if (items[0][1] != 1) goto bad_header;
+ if (items[0][1] != 1)
+ goto bad_header;
+
switch (text[items[0][0]]) {
case '2': msg->code = CALL; break;
case '3': msg->code = RETOK; break;
diff --git a/src/sig-monitor.c b/src/sig-monitor.c
index f15f214e..70592812 100644
--- a/src/sig-monitor.c
+++ b/src/sig-monitor.c
@@ -154,7 +154,7 @@ static inline int timeout_create()
rc = timer_create(CLOCK_THREAD_CPUTIME_ID, &sevp, &thread_timerid);
thread_timer_set = !rc;
}
- return 0;
+ return rc;
}
/*