From a4da4fe57467231c4e29ffb01c3c3d1692024e51 Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sun, 1 May 2016 10:59:22 +0100 Subject: [PATCH] authd: fix memory leak in start_auth --- authd/provider.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authd/provider.c b/authd/provider.c index da74496d..11991877 100644 --- a/authd/provider.c +++ b/authd/provider.c @@ -279,13 +279,14 @@ accept_client(struct auth_client *auth, uint32_t id) static void start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_ip, const char *c_port) { - struct auth_client *auth = rb_malloc(sizeof(struct auth_client)); + struct auth_client *auth; long lcid = strtol(cid, NULL, 16); rb_dlink_node *ptr; if(lcid >= UINT32_MAX) return; + auth = rb_malloc(sizeof(struct auth_client)); auth->cid = (uint32_t)lcid; if(rb_dictionary_find(auth_clients, RB_UINT_TO_POINTER(auth->cid)) == NULL)