Skip to content

Commit

Permalink
no need to check for null ptr on free
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Jan 8, 2025
1 parent 8e1e4ad commit 2b61015
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions jni-c-toxcore/jni-c-toxcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,7 @@ void update_savedata_file(const Tox *tox, const uint8_t *passphrase, size_t pass
if (tox == NULL)
{
dbg(9, "update_savedata_file:ERROR:tox ptr is NULL");
if(savedata)
{
free(savedata);
}
free(savedata);
return;
}
tox_get_savedata(tox, (uint8_t *)savedata);
Expand Down

0 comments on commit 2b61015

Please sign in to comment.