summaryrefslogtreecommitdiff
path: root/common/stdio.c
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 /common/stdio.c
parentdfe5b1c86f1a79841e00c68d71d8027b223d4aa7 (diff)
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>
Diffstat (limited to 'common/stdio.c')
-rw-r--r--common/stdio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/stdio.c b/common/stdio.c
index 68c595d2d79..adbfc890dd4 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)) {