Change-Id: Ibb73cebc99094b33b61820482327296049c2026a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
#include "afb-hreq.h"
#include "afb-subcall.h"
#include "afb-session.h"
+#include "afb-cred.h"
#include "verbose.h"
#include "locale-root.h"
json_object_put(hreq->json);
free((char*)hreq->xreq.api);
free((char*)hreq->xreq.verb);
+ afb_cred_unref(hreq->xreq.cred);
free(hreq);
}
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;
goto error4;
result->cred = afb_cred_create_for_socket(fd);
+ if (!result->cred)
+ result->cred = afb_cred_current();
result->apiset = afb_apiset_addref(apiset);
return result;