Silence Coverity issue in SDL_sound
Coverity finds use after free on value pointed by sample_list, but fails to detect, that this is a global variable, that is being updated by Sound_FreeSample before freeing any memory. This code is obviously written with the purpose of freeing whole list, so there's nothing unexpected here - this is definitely a false positive finding. We could mark this issue as false-positive in Coverity, but I think it's better to avoid tripping it in the first place.
This commit is contained in:
parent
cc6cd3af00
commit
0d71bf0ea4
1 changed files with 4 additions and 1 deletions
|
@ -145,7 +145,10 @@ int Sound_Quit(void)
|
|||
BAIL_IF_MACRO(!initialized, ERR_NOT_INITIALIZED, 0);
|
||||
|
||||
while (((volatile Sound_Sample *) sample_list) != NULL)
|
||||
Sound_FreeSample(sample_list);
|
||||
{
|
||||
Sound_Sample *sample = sample_list;
|
||||
Sound_FreeSample(sample); /* Updates sample_list. */
|
||||
}
|
||||
|
||||
initialized = 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue