Skip to content

Commit

Permalink
fix null pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Aug 29, 2023
1 parent 45e27a0 commit abf3d77
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions toxav/toxav.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,13 @@ ToxAV *toxav_new(Tox *tox, Toxav_Err_New *error)
}

if (rc != TOXAV_ERR_NEW_OK) {
logger_kill(av->log);
free(av);
av = nullptr;
if (av) {

Check warning on line 285 in toxav/toxav.c

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

toxav/toxav.c#L285

MISRA 14.4 rule
if (av->log) {
logger_kill(av->log);
}
free(av);
av = nullptr;
}
}

return av;
Expand Down

0 comments on commit abf3d77

Please sign in to comment.