From: Hans de Goede Date: Wed, 24 Sep 2014 12:06:09 +0000 (+0200) Subject: stdio: Fix memleak on stdio_deregister X-Git-Tag: v2015.01-rc1~57 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=88274b6c431f48d44743fe4d007068bec63505ff;p=oweals%2Fu-boot.git 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 --- 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)) {