[U-Boot] [PATCH 1/2] video: truetype: Fix a memory leak on error

Simon Glass sjg at chromium.org
Mon Feb 22 05:10:25 CET 2016


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 at chromium.org>
---

 drivers/video/console_truetype.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index c249f04..e16f95a 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -289,6 +289,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,
 		}
 #endif
 		default:
+			free(data);
 			return -ENOSYS;
 		}
 
-- 
2.7.0.rc3.207.g0ac5344



More information about the U-Boot mailing list