Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH 6/6] uprobe: fix memory leak
@ 2026-04-28 19:05 Kris Van Hees
  2026-04-28 20:54 ` Nick Alcock
  0 siblings, 1 reply; 2+ messages in thread
From: Kris Van Hees @ 2026-04-28 19:05 UTC (permalink / raw)
  To: dtrace, dtrace-devel

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 libdtrace/dt_prov_uprobe.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libdtrace/dt_prov_uprobe.c b/libdtrace/dt_prov_uprobe.c
index e575b0724..0e0f6a560 100644
--- a/libdtrace/dt_prov_uprobe.c
+++ b/libdtrace/dt_prov_uprobe.c
@@ -434,6 +434,7 @@ static void probe_destroy_underlying(dtrace_hdl_t *dtp, void *datap)
 static void probe_destroy(dtrace_hdl_t *dtp, void *datap)
 {
 	free_probe_list(dtp, datap);
+	dt_free(dtp, datap);
 }
 
 static void detach(dtrace_hdl_t *dtp, const dt_probe_t *uprp)
@@ -1701,8 +1702,14 @@ oom:
 	return dt_set_errno(dtp, EDT_NOMEM);
 }
 
-/* Clean up the private provider data. */
-static void destroy(dtrace_hdl_t *dtp, void *arg)
+/* Clean up the private uproobe provider data. */
+static void destroy_uprobe(dtrace_hdl_t *dtp, void *arg)
+{
+	dt_free(dtp, arg);
+}
+
+/* Clean up the private USDT provider data. */
+static void destroy_usdt(dtrace_hdl_t *dtp, void *arg)
 {
 	dt_htab_destroy((dt_htab_t *)arg);
 }
@@ -1720,6 +1727,7 @@ dt_provimpl_t	dt_uprobe = {
 	.detach		= &detach,
 	.probe_destroy	= &probe_destroy_underlying,
 	.add_probe	= &add_probe_uprobe,
+	.destroy	= &destroy_uprobe,
 };
 
 /*
@@ -1746,7 +1754,7 @@ dt_provimpl_t	dt_usdt = {
 	.probe_destroy	= &probe_destroy,
 	.discover	= &discover,
 	.add_probe	= &add_probe_usdt,
-	.destroy	= &destroy,
+	.destroy	= &destroy_usdt,
 };
 
 /*
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-28 20:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 19:05 [PATCH 6/6] uprobe: fix memory leak Kris Van Hees
2026-04-28 20:54 ` Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox