authd: fix memory leak in start_auth
This commit is contained in:
parent
9f928dc532
commit
a4da4fe574
1 changed files with 2 additions and 1 deletions
|
@ -279,13 +279,14 @@ accept_client(struct auth_client *auth, uint32_t id)
|
||||||
static void
|
static void
|
||||||
start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_ip, const char *c_port)
|
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);
|
long lcid = strtol(cid, NULL, 16);
|
||||||
rb_dlink_node *ptr;
|
rb_dlink_node *ptr;
|
||||||
|
|
||||||
if(lcid >= UINT32_MAX)
|
if(lcid >= UINT32_MAX)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auth = rb_malloc(sizeof(struct auth_client));
|
||||||
auth->cid = (uint32_t)lcid;
|
auth->cid = (uint32_t)lcid;
|
||||||
|
|
||||||
if(rb_dictionary_find(auth_clients, RB_UINT_TO_POINTER(auth->cid)) == NULL)
|
if(rb_dictionary_find(auth_clients, RB_UINT_TO_POINTER(auth->cid)) == NULL)
|
||||||
|
|
Loading…
Reference in a new issue