Add 'afb_service_call_sync' function
[src/app-framework-binder.git] / src / afb-hreq.c
index fe5af73..62b322c 100644 (file)
@@ -37,8 +37,8 @@
 #include "afb-msg-json.h"
 #include "afb-context.h"
 #include "afb-hreq.h"
-#include "afb-subcall.h"
 #include "afb-session.h"
+#include "afb-cred.h"
 #include "verbose.h"
 #include "locale-root.h"
 
@@ -319,6 +319,7 @@ static void req_destroy(struct afb_xreq *xreq)
        json_object_put(hreq->json);
        free((char*)hreq->xreq.api);
        free((char*)hreq->xreq.verb);
+       afb_cred_unref(hreq->xreq.cred);
        free(hreq);
 }
 
@@ -981,6 +982,7 @@ struct afb_hreq *afb_hreq_create()
        if (hreq) {
                /* init the request */
                afb_xreq_init(&hreq->xreq, &afb_hreq_xreq_query_itf);
+               hreq->xreq.cred = afb_cred_current();
                hreq->reqid = ++global_reqids;
        }
        return hreq;