video: truetype: Fix a memory leak on error
authorSimon Glass <sjg@chromium.org>
Mon, 22 Feb 2016 04:10:25 +0000 (21:10 -0700)
committerAnatolij Gustschin <agust@denx.de>
Mon, 22 Feb 2016 13:41:02 +0000 (14:41 +0100)
When the resolution is not supported we should free the memory we don't plan
to use.

Reported-by: Coverity (CID: 135127)
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/video/console_truetype.c

index c249f047f5b21b237a1ac6f2a0ca3b48e08ee89d..e16f95a02ce61f282caa41c4b3c46babb88291d3 100644 (file)
@@ -289,6 +289,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,
                }
 #endif
                default:
+                       free(data);
                        return -ENOSYS;
                }