|SUCCESS| graph/conn: fix memory leak on socket init failure
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Jun 2 16:25:07 CEST 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/164796
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-06-02
commit 3f90eda5b7fb ("app/graph: add telnet connectivity")
Author: Alexey Simakov <bigalex934 at gmail.com>
Subject: [PATCH] graph/conn: fix memory leak on socket init failure
This patch adds a missing free(c->buf) call in conn_free() to prevent a
memory leak when server socket creation fails in conn_init().
> diff --git a/app/graph/conn.c b/app/graph/conn.c
> index c5e1c1ae1b..e73e929a08 100644
> --- a/app/graph/conn.c
> +++ b/app/graph/conn.c
[ ... ]
> @@ -197,6 +197,7 @@ conn_free(struct conn *c)
> free(c->msg_in);
> free(c->prompt);
> free(c->welcome);
> + free(c->buf);
> free(c);
> }
In the sequence of free() calls, should c->buf be freed earlier to
follow some order (perhaps matching allocation order in conn_init() or
conn_poll())?
Does this fix fully resolve the leak, or are there other paths where
conn_free() is called and c->buf was already freed separately? Can
c->buf become NULL in any scenario, and is free(NULL) safe in the rest
of conn_free() already?
More information about the test-report
mailing list