summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniele Forsi <dforsi@gmail.com>2014-07-26 11:37:41 +0200
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-07-28 23:16:20 +0200
commit6e3712f9e11582f98630d404ce48a538716d8fee (patch)
treebd84df21c6c200ff6f65afdd6cd4409d44f7f08d /src
parentf9ce88e942a70a1aaa1f0951f8fab436a2ea82f5 (diff)
device/oprom/yabel/vbe.c: Fix memory leak
Do not allocate memory if the bootsplash was not found. Found by Cppcheck 1.65. Fixes: [src/device/oprom/yabel/vbe.c:734]: (error) Memory leak: decdata Change-Id: Ie2283165c9d7650dce9baf9e892dd055d44dcce5 Signed-off-by: Daniele Forsi <dforsi@gmail.com> Reviewed-on: http://review.coreboot.org/6377 Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src')
-rw-r--r--src/device/oprom/yabel/vbe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/oprom/yabel/vbe.c b/src/device/oprom/yabel/vbe.c
index 6283bbb7f1..6354afe92e 100644
--- a/src/device/oprom/yabel/vbe.c
+++ b/src/device/oprom/yabel/vbe.c
@@ -719,7 +719,6 @@ void vbe_set_graphics(void)
DEBUG_PRINTF_VBE("FRAMEBUFFER: 0x%p\n", framebuffer);
struct jpeg_decdata *decdata;
- decdata = malloc(sizeof(*decdata));
/* Switching Intel IGD to 1MB video memory will break this. Who
* cares. */
@@ -736,6 +735,7 @@ void vbe_set_graphics(void)
DEBUG_PRINTF_VBE("Splash at %p ...\n", jpeg);
dump(jpeg, 64);
+ decdata = malloc(sizeof(*decdata));
int ret = 0;
DEBUG_PRINTF_VBE("Decompressing boot splash screen...\n");
ret = jpeg_decode(jpeg, framebuffer, 1024, 768, 16, decdata);