summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-08-08 17:50:21 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-08-08 18:17:46 +0200
commit3304fba98ed2e207925d380ae181ff49fbecc0a1 (patch)
treec5ad7e0caf4238ad3ec8b4c74e361eb268010dae
parent615cad14e67a2317b9aee95b663dbc21c851a180 (diff)
afb-session: fix an over allocation
Thanks to Markus Fritzsch and clang-check Change-Id: I4822eb14bff49680df05e472363228cc82566edf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afb-session.c b/src/afb-session.c
index 536cdbcc..6fb29bf8 100644
--- a/src/afb-session.c
+++ b/src/afb-session.c
@@ -120,7 +120,7 @@ static void free_data (struct afb_session *session)
void afb_session_init (int max_session_count, int timeout, const char *initok)
{
// let's create as store as hashtable does not have any
- sessions.store = calloc (1 + (unsigned)max_session_count, sizeof(struct afb_session));
+ sessions.store = calloc (1 + (unsigned)max_session_count, sizeof *sessions.store);
pthread_mutex_init(&sessions.mutex, NULL);
sessions.max = max_session_count;
sessions.timeout = timeout;