Skip to content

Commit

Permalink
Fix code scanning alert no. 96: Potential use after free
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 2c5b7fe commit 31771e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redalert/unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4400,8 +4400,10 @@ BulletClass* UnitClass::Fire_At(TARGET target, int which)

if (bullet != NULL) {
#ifdef FIXIT_CSII // checked - ajw 9/28/98
if (Class->Type == UNIT_DEMOTRUCK && IsActive)
if (Class->Type == UNIT_DEMOTRUCK && IsActive) {
delete this;
return NULL;
}
#endif
/*
** Possible reload timer set.
Expand Down

0 comments on commit 31771e5

Please sign in to comment.