Explorar o código

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>
Hans de Goede %!s(int64=10) %!d(string=hai) anos
pai
achega
88274b6c43
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      common/stdio.c

+ 1 - 0
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)) {