From 994408a770a50cf698eb98e67b7b54d41b9b6a88 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 26 Oct 2009 06:20:13 +0000 Subject: Fixed some cppcheck warnings. svn-id: r45391 --- engines/sci/sfx/softseq/amiga.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/sci/sfx/softseq/amiga.cpp') diff --git a/engines/sci/sfx/softseq/amiga.cpp b/engines/sci/sfx/softseq/amiga.cpp index 6094201169..388e5685fd 100644 --- a/engines/sci/sfx/softseq/amiga.cpp +++ b/engines/sci/sfx/softseq/amiga.cpp @@ -413,6 +413,8 @@ static instrument_t *read_instrument(Common::File &file, int *id) { instrument->samples = (int8 *) malloc(size + 1); if (file.read(instrument->samples, size) < (unsigned int)size) { warning("[sfx:seq:amiga] failed to read instrument samples"); + free(instrument->samples); + free(instrument); return NULL; } @@ -427,6 +429,8 @@ static instrument_t *read_instrument(Common::File &file, int *id) { if (seg_size[1] < 0) { warning("[sfx:seq:amiga] invalid looping point"); + free(instrument->samples); + free(instrument); return NULL; } -- cgit v1.2.3