VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-07-09 05:35:56 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 23:20:43 +0100
commit899a22b840316d54a9563726e78f7a201a6702ef (patch)
tree9a3fe9f081b3b9554c29bc6b3cd6f3ae50def710 /src/Common/Dlgcode.c
parent5281e2d3b9adea8dff1730d78fe94af85582aea8 (diff)
downloadVeraCrypt-899a22b840316d54a9563726e78f7a201a6702ef.tar.gz
VeraCrypt-899a22b840316d54a9563726e78f7a201a6702ef.zip
Static Code Analysis : fix various memory leaks.
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index f645fdec..084e93d5 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -6743,7 +6743,11 @@ __int64 FindStringInFile (const char *filePath, const char* str, int strLen)
|| buffer == NULL
|| strLen > bufSize
|| strLen < 1)
+ {
+ if (buffer)
+ free (buffer);
return -1;
+ }
src = CreateFile (filePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);