spu2-x:linux: Fix potential null deference

Coverity CID 146911: Dereference before null check (REVERSE_INULL)
This commit is contained in:
Jonathan Li 2015-10-18 13:59:21 +01:00
parent d5e0899955
commit 7fac189ab3
1 changed files with 5 additions and 3 deletions

View File

@ -60,9 +60,11 @@ WavOutFile::WavOutFile(const char *fileName, int sampleRate, int bits, int chann
WavOutFile::~WavOutFile()
{
finishHeader();
if (fptr) fclose(fptr);
fptr = NULL;
if (fptr)
{
finishHeader();
fclose(fptr);
}
}