graph/conn: fix memory leak on socket init failure
PATCH 1/1 graph/conn: fix memory leak on socket init failure
In conn_init(), conn_free() does not release the buffer allocated for conn structure, resulting in a memory leak when server socket creation fails.
Add missing free(c->buf) call to conn_free().
Fixes 3f90eda5b7fb ("app/graph: add telnet connectivity")
Signed-off-by Alexey Simakov <[email protected]>
--- app/graph/conn.c | 1 + 1 file changed, 1 insertion(+)
app/graph/conn.c +1 -0
@@ -197,6 +197,7 @@ conn_free(struct conn *c)free (c->msg_in);free (c->prompt);free (c->welcome); +free (c->buf);free (c); }
Signature · 1 line
2.34.1
Thomas Monjalon
Applied02/06/2026 15:12, Alexey Simakov:
Quoted 10 lines
In
conn_init(),conn_free()does not release the buffer allocated for conn structure, resulting in a memory leak when server socket creation fails.Add missing
free(c->buf)call toconn_free().Fixes 3f90eda5b7fb ("app/graph: add telnet connectivity")Signed-off-by Alexey Simakov <[email protected]>
Applied, thanks.
Note: it seems to fix also the normal case.