From 7bc02c61bd9ae041359aac3a3712cf4b645a08e0 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 15 Sep 2008 13:02:39 +0000 Subject: [PATCH] simplified this weird code, while also fixing CID 1059 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27528 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/translators/gif/GIFTranslator.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/add-ons/translators/gif/GIFTranslator.cpp b/src/add-ons/translators/gif/GIFTranslator.cpp index 6d1025dd00..ecab7ff2fb 100644 --- a/src/add-ons/translators/gif/GIFTranslator.cpp +++ b/src/add-ons/translators/gif/GIFTranslator.cpp @@ -186,20 +186,18 @@ Translate(BPositionIO *inSource, const translator_info *inInfo, bigtime_t now = system_time(); // Going from BBitmap to GIF if (!is_gif) { - BBitmap **b = (BBitmap **)malloc(4); - *b = NULL; - err = GetBitmap(inSource, b); - if (err != B_OK) return err; - GIFSave *gs = new GIFSave(*b, outDestination); + BBitmap *bitmap = NULL; + err = GetBitmap(inSource, &bitmap); + if (err != B_OK) + return err; + GIFSave *gs = new GIFSave(bitmap, outDestination); if (gs->fatalerror) { delete gs; - if (*b != NULL) delete *b; - delete b; + delete bitmap; return B_NO_MEMORY; } delete gs; - delete *b; - delete b; + delete bitmap; } else { // GIF to BBitmap GIFLoad *gl = new GIFLoad(inSource, outDestination); if (gl->fatalerror) {