Skip to content
Snippets Groups Projects
Commit 50ea9c86 authored by ale's avatar ale
Browse files

Fix memory leak on successful deserialization

parent 782b3662
No related branches found
No related tags found
1 merge request!5Refactor ticket deserialization code
......@@ -218,7 +218,8 @@ static int sso_ticket_deserialize(sso_ticket_t *t, const char *s, int sz) {
*session_id = NULL;
char **groups = NULL;
time_t expires = 0;
int err, field_size;
int err = SSO_OK;
int field_size;
int i = 0, last = 0, field = 0;
char *token;
......@@ -261,7 +262,7 @@ static int sso_ticket_deserialize(sso_ticket_t *t, const char *s, int sz) {
free(token);
break;
case 7:
groups = (char **)group_list_parse(token);
groups = group_list_parse(token);
free(token);
break;
default:
......@@ -285,8 +286,6 @@ static int sso_ticket_deserialize(sso_ticket_t *t, const char *s, int sz) {
}
*t = sso_ticket_new(user, service, domain, nonce, session_id, (const char **)groups, expires);
free(version);
return SSO_OK;
fail:
if (version != NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment