Skip to contentSkip to conversation

graph/conn: fix memory leak on socket init failure

PATCH Applied Alexey Simakov 2 participants 2 messages Jun 2 – Oct 15

lore
Share & tools
lore
#0 lore raw

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")
---
 app/graph/conn.c | 1 +
 1 file changed, 1 insertion(+)
app/graph/conn.c +1 -0
index c5e1c1ae1b..e73e929a08 100644
@@ -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
#1 lore raw

02/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 to conn_free().

Fixes 3f90eda5b7fb ("app/graph: add telnet connectivity")

Applied, thanks.
Note: it seems to fix also the normal case.