On 7/9/21 9:00 AM, dapengx...@intel.com wrote: > From: Dapeng Yu <dapengx...@intel.com> > > In function softnic_conn_init(), a block of memory is allocated as > connection buffer, but it is never freed in softnic_conn_free(), > which cause memory leak. > > This patch fixes it. > > Fixes: 7709a63bf178 ("net/softnic: add connection agent") > Cc: sta...@dpdk.org > > Signed-off-by: Dapeng Yu <dapengx...@intel.com> > --- > drivers/net/softnic/conn.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/softnic/conn.c b/drivers/net/softnic/conn.c > index 8b66580887..a9548beac7 100644 > --- a/drivers/net/softnic/conn.c > +++ b/drivers/net/softnic/conn.c > @@ -146,6 +146,7 @@ softnic_conn_free(struct softnic_conn *conn) > free(conn->msg_in); > free(conn->prompt); > free(conn->welcome); > + free(conn->buf); > free(conn); > } > >
Fixed order to free in reverse order vs fields in the structure and allocation. Reviewed-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru> Applied, thanks.