소스 검색

video: truetype: Fix a memory leak on error

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>
Simon Glass 9 년 전
부모
커밋
f6e75ba7fe
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      drivers/video/console_truetype.c

+ 1 - 0
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;
 		}