forked from Telodendria/Telodendria
Fix leak in RegTokenClose().
This commit is contained in:
parent
647778ef82
commit
d60aac6d3a
1 changed files with 5 additions and 1 deletions
|
@ -154,13 +154,17 @@ RegTokenFree(RegTokenInfo *tokeninfo)
|
||||||
int
|
int
|
||||||
RegTokenClose(RegTokenInfo * tokeninfo)
|
RegTokenClose(RegTokenInfo * tokeninfo)
|
||||||
{
|
{
|
||||||
|
HashMap *json;
|
||||||
|
|
||||||
if (!tokeninfo)
|
if (!tokeninfo)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write object to database. */
|
/* Write object to database. */
|
||||||
DbJsonSet(tokeninfo->ref, RegTokenInfoToJson(tokeninfo));
|
json = RegTokenInfoToJson(tokeninfo);
|
||||||
|
DbJsonSet(tokeninfo->ref, json); /* Copies json into internal structure. */
|
||||||
|
JsonFree(json);
|
||||||
|
|
||||||
return DbUnlock(tokeninfo->db, tokeninfo->ref);
|
return DbUnlock(tokeninfo->db, tokeninfo->ref);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue