[Bug 269509] Memory leak in ofwbus
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 269509] Memory leak in ofwbus"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 269509] Memory leak in ofwbus"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 269509] Memory leak in ofwbus"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 269509] Memory leak in ofwbus"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 12 Feb 2023 07:47:39 UTC
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.