rpcbind: fix double free in init_transport
Subsystems (2)
PATCH 1/1 rpcbind: fix double free in init_transport
$ rpcbind -h 127.0.0.1 free(): double free detected in tcache 2 Aborted
Fixes a6889bba949b ("Removed resource leaks from src/rpcbind.c")
Resolves: https://sourceforge.net/p/rpcbind/bugs/6/
Signed-off-by Dmitry V. Levin <[email protected]>
--- src/rpcbind.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/rpcbind.c +3 -1
@@ -552,8 +552,10 @@ init_transport(struct netconfig *nconf)syslog (LOG_ERR ,"cannot bind %s on %s: %m" , (hosts[nhostsbak] ==NULL ) ?"*" : hosts[nhostsbak], nconf->nc_netid); -if (res !=NULL ) +if (res !=NULL ) {freeaddrinfo (res); + res =NULL ; + }continue ; }else checkbind++;
Signature · 1 line
ldv
Quoted 7 lines · Dmitry V. Levin
$ rpcbind -h 127.0.0.1 free(): double free detected in tcache 2 AbortedFixes a6889bba949b ("Removed resource leaks from src/rpcbind.c")Resolves: https://sourceforge.net/p/rpcbind/bugs/6/
Signed-off-by Dmitry V. Levin <[email protected]>
Committed... (tag: rpcbind-1_2_7-rc1)
steved.
Quoted 20 lines
--- src/rpcbind.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)src/rpcbind.c +3
-1@@ -552,8 +552,10 @@ init_transport(struct netconfig *nconf)syslog (LOG_ERR ,"cannot bind %s on %s: %m" , (hosts[nhostsbak] ==NULL ) ?"*" : hosts[nhostsbak], nconf->nc_netid); -if (res !=NULL ) +if (res !=NULL ) {freeaddrinfo (res); + res =NULL ; + }continue ; }else checkbind++;