summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-02 20:34:23 +0000
committerphk <phk@FreeBSD.org>2002-10-02 20:34:23 +0000
commitfed084139408b0d6534923ce71871f662b3f424c (patch)
tree1252083c93a2eb6df092da12c45f4d47d053d6ca /sys/dev/fb
parentb79961de9543536d9734d8686e54a65c7f3cafab (diff)
downloadFreeBSD-src-fed084139408b0d6534923ce71871f662b3f424c.zip
FreeBSD-src-fed084139408b0d6534923ce71871f662b3f424c.tar.gz
Fix rare and probably inconsequential memory leak.
Spotted by: FlexeLint
Diffstat (limited to 'sys/dev/fb')
-rw-r--r--sys/dev/fb/vga.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index ba876fc..f6aab6e 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);
OpenPOWER on IntegriCloud