From ce2aa639f448e4585e953fd14292dc0a9c5c4d86 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 11 Jun 2017 17:26:42 +0200 Subject: Windows: various fixes following Coverity analysis. --- src/Common/Format.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Common/Format.c') diff --git a/src/Common/Format.c b/src/Common/Format.c index a7445a9d..cd211db7 100644 --- a/src/Common/Format.c +++ b/src/Common/Format.c @@ -163,11 +163,12 @@ int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams) FormatSectorSize, FALSE); - if (nStatus != 0) + /* cryptoInfo sanity check to make Coverity happy eventhough it can't be NULL if nStatus = 0 */ + if ((nStatus != 0) || !cryptoInfo) { burn (header, sizeof (header)); VirtualUnlock (header, sizeof (header)); - return nStatus; + return nStatus? nStatus : ERR_OUTOFMEMORY; } begin_format: -- cgit v1.2.3