Skip to content

Commit 71bc971

Browse files
committed
oidc_child: free json objects properly
1 parent 0203efe commit 71bc971

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/oidc_child/oidc_child_json.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,18 @@ static int token_destructor(void *p)
407407
struct token_data *td = talloc_get_type(p, struct token_data);
408408

409409
json_decref(td->result);
410+
if (td->userinfo != NULL) {
411+
json_decref(td->userinfo);
412+
}
413+
if (td->access_token_payload != NULL) {
414+
json_decref(td->access_token_payload);
415+
}
416+
if (td->id_token_payload != NULL) {
417+
json_decref(td->id_token_payload);
418+
}
419+
if (td->refresh_token_payload != NULL) {
420+
json_decref(td->refresh_token_payload);
421+
}
410422

411423
return 0;
412424
}

0 commit comments

Comments
 (0)