Date: Sun, 12 Feb 2023 07:47:39 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 269509] Memory leak in ofwbus Message-ID: <bug-269509-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269509 Bug ID: 269509 Summary: Memory leak in ofwbus Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: jarek@jpelczar.com The ofwbus_attach function (in sys/dev/ofw/ofwbus.c) performs iteration over nodes. for (node = OF_child(node); node > 0; node = OF_peer(node)) { if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) continue; simplebus_add_device(dev, node, 0, NULL, -1, NULL); } ofw_bus_gen_setup_devinfo allocates memory to temporary buffer, however this memory is never freed, so the change should probably look as follows: for (node = OF_child(node); node > 0; node = OF_peer(node)) { if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) continue; simplebus_add_device(dev, node, 0, NULL, -1, NULL); + ofw_bus_gen_destroy_devinfo(&obd); } -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269509-227>
