From 7fac189ab30ab983e2cd726b8854ff1f3733aa98 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sun, 18 Oct 2015 13:59:21 +0100 Subject: [PATCH] spu2-x:linux: Fix potential null deference Coverity CID 146911: Dereference before null check (REVERSE_INULL) --- plugins/spu2-x/src/WavFile.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/spu2-x/src/WavFile.cpp b/plugins/spu2-x/src/WavFile.cpp index dc0953ace3..d44e58d4a7 100644 --- a/plugins/spu2-x/src/WavFile.cpp +++ b/plugins/spu2-x/src/WavFile.cpp @@ -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); + } }