Update copyright dates
[src/app-framework-binder.git] / bindings / samples / hello3.c
index af19478..3a6c9ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2019 "IoT.bzh"
+ * Copyright (C) 2015-2020 "IoT.bzh"
  * Author "Fulup Ar Foll"
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -424,7 +424,7 @@ static void broadcast(afb_req_t request)
                        afb_req_success(request, NULL, NULL);
                pthread_mutex_unlock(&mutex);
        } else if (name != NULL) {
-               if (0 > afb_daemon_broadcast_event(name, object))
+               if (0 > afb_daemon_broadcast_event(name, json_object_get(object)))
                        afb_req_fail(request, "failed", "broadcast error");
                else
                        afb_req_success(request, NULL, NULL);
@@ -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;
                }