summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-24 14:06:09 +0200
committerMarek Vasut <marex@denx.de>2014-11-04 06:04:00 +0100
commit88274b6c431f48d44743fe4d007068bec63505ff (patch)
treef8cefe1c9a810b235fecf3965fe5e4d5f620c631
parentdfe5b1c86f1a79841e00c68d71d8027b223d4aa7 (diff)
downloadblackbird-obmc-uboot-88274b6c431f48d44743fe4d007068bec63505ff.tar.gz
blackbird-obmc-uboot-88274b6c431f48d44743fe4d007068bec63505ff.zip
stdio: Fix memleak on stdio_deregister
stdio_register makes a malloc-ed copy of struct stdio_dev through stdio_clone, free the malloc-ed memory on stdio_deregister. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--common/stdio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/stdio.c b/common/stdio.c
index 68c595d2d7..adbfc890dd 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -197,6 +197,7 @@ int stdio_deregister_dev(struct stdio_dev *dev, int force)
}
list_del(&(dev->list));
+ free(dev);
/* reassign Device list */
list_for_each(pos, &(devs.list)) {
OpenPOWER on IntegriCloud