From de6ba1a073146873cb2dd6bb3aefab18f2eb37d1 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 12 Aug 2010 13:16:40 +0000 Subject: [PATCH] CID 1393: Memory leak. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38051 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/translators/gif/GIFTranslator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/add-ons/translators/gif/GIFTranslator.cpp b/src/add-ons/translators/gif/GIFTranslator.cpp index 510fd88cb6..e4bb537bb6 100644 --- a/src/add-ons/translators/gif/GIFTranslator.cpp +++ b/src/add-ons/translators/gif/GIFTranslator.cpp @@ -124,7 +124,10 @@ GetBitmap(BPositionIO *in, BBitmap **out) } err = in->Read(bits, header.dataSize); if (err == (status_t)header.dataSize) return B_OK; - else return B_IO_ERROR; + else { + delete bitmap; + return B_IO_ERROR; + } }