From 8311f05a45f1bd66a3a85864b4e2173800c54ef6 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Wed, 2 Oct 2002 20:34:23 +0000 Subject: Fix rare and probably inconsequential memory leak. Spotted by: FlexeLint --- sys/dev/fb/vga.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c index ba876fc7480e..f6aab6e22520 100644 --- a/sys/dev/fb/vga.c +++ b/sys/dev/fb/vga.c @@ -2850,8 +2850,10 @@ get_palette(video_adapter_t *adp, int base, int count, r = malloc(count*3, M_DEVBUF, M_WAITOK); g = r + count; b = g + count; - if (vga_save_palette2(adp, base, count, r, g, b)) + if (vga_save_palette2(adp, base, count, r, g, b)) { + free(r, M_DEVBUF); return ENODEV; + } copyout(r, red, count); copyout(g, green, count); copyout(b, blue, count); -- cgit v1.3