* [PATCH] rpcbind: fix double free in init_transport
@ 2022-01-29 0:44 Dmitry V. Levin
2022-02-01 13:48 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry V. Levin @ 2022-01-29 0:44 UTC (permalink / raw)
To: Steve Dickson; +Cc: libtirpc-devel, linux-nfs
$ 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 <ldv@altlinux.org>
---
src/rpcbind.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/rpcbind.c b/src/rpcbind.c
index 25d8a90..ecebe97 100644
--- a/src/rpcbind.c
+++ b/src/rpcbind.c
@@ -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++;
--
ldv
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rpcbind: fix double free in init_transport
2022-01-29 0:44 [PATCH] rpcbind: fix double free in init_transport Dmitry V. Levin
@ 2022-02-01 13:48 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2022-02-01 13:48 UTC (permalink / raw)
To: Dmitry V. Levin; +Cc: libtirpc-devel, linux-nfs
On 1/28/22 19:44, Dmitry V. Levin wrote:
> $ 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 <ldv@altlinux.org>
Committed... (tag: rpcbind-1_2_7-rc1)
steved.
> ---
> src/rpcbind.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/rpcbind.c b/src/rpcbind.c
> index 25d8a90..ecebe97 100644
> --- a/src/rpcbind.c
> +++ b/src/rpcbind.c
> @@ -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++;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-01 13:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 0:44 [PATCH] rpcbind: fix double free in init_transport Dmitry V. Levin
2022-02-01 13:48 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).