Fix small issues
[src/app-framework-binder.git] / bindings / samples / hello3.c
index 131e0e4..ff7da61 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2018 "IoT.bzh"
+ * Copyright (C) 2015-2019 "IoT.bzh"
  * Author "Fulup Ar Foll"
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -627,7 +627,6 @@ static void in_after (afb_req_t request)
        char *te;
        double td;
        struct timespec t;
-       void (*calling)(afb_req_t);
 
        /* get the type */
        ty = afb_req_value(request, "type") ?: "call";
@@ -914,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;
                }