public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpcbind] f44: Fix leak of nconf in main()
@ 2026-07-01 15:43 Steve Dickson
0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2026-07-01 15:43 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rpcbind
Branch : f44
Commit : e3a79e2cb3d65b16ec713aea12b62d900342ee07
Author : Steve Dickson <steved@redhat.com>
Date : 2026-07-01T11:38:31-04:00
Stats : +36/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpcbind/c/e3a79e2cb3d65b16ec713aea12b62d900342ee07?branch=f44
Log:
Fix leak of nconf in main()
Signed-off-by: Steve Dickson <steved@redhat.com>
---
diff --git a/rpcbind-0.2.9-mem-leak-main.patch b/rpcbind-0.2.9-mem-leak-main.patch
new file mode 100644
index 0000000..66ec28c
--- /dev/null
+++ b/rpcbind-0.2.9-mem-leak-main.patch
@@ -0,0 +1,30 @@
+commit d7db84aefb2e302bab281d4fba31e498528ef531
+Author: Scott Mayhew <smayhew@redhat.com>
+Date: Wed Jul 1 08:31:13 2026 -0400
+
+ rpcbind: fix leak of nconf in main()
+
+ Before reusing nconf in the getnetconfig() loop, we need to free the
+ memory that was previously allocated via getnetconfigent(). Fixes the
+ following leak reported by valgrind:
+
+ ==9031== 1,136 (136 direct, 1,000 indirect) bytes in 1 blocks are definitely lost in loss record 63 of 67
+ ==9031== at 0x485183E: malloc (vg_replace_malloc.c:447)
+ ==9031== by 0x4879D1F: getnetconfigent (in /usr/lib64/libtirpc.so.3.0.0)
+ ==9031== by 0x4004336: main (rpcbind.c:271)
+
+ Signed-off-by: Scott Mayhew <smayhew@redhat.com>
+ Signed-off-by: Steve Dickson <steved@redhat.com>
+
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 4212377..c39df97 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -282,6 +282,7 @@ main(int argc, char *argv[])
+ rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
+
+ init_transport(nconf);
++ freenetconfigent(nconf);
+
+ while ((nconf = getnetconfig(nc_handle))) {
+ if (nconf->nc_flag & NC_VISIBLE)
diff --git a/rpcbind.spec b/rpcbind.spec
index b6850e4..75fc09b 100644
--- a/rpcbind.spec
+++ b/rpcbind.spec
@@ -4,7 +4,7 @@
Name: rpcbind
Version: 1.2.9
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Universal Addresses to RPC Program Number Mapper
License: BSD-3-Clause
URL: https://sourceforge.net/projects/rpcbind
@@ -23,6 +23,8 @@ Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd coreutils
+Patch001: rpcbind-0.2.9-mem-leak-main.patch
+
Patch100: rpcbind-0.2.3-systemd-tmpfiles.patch
Patch101: rpcbind-0.2.4-systemd-rundir.patch
@@ -118,6 +120,9 @@ install -m0644 -D rpcbind.sysusers.conf %{buildroot}%{_sysusersdir}/rpcbind.conf
%{_sysusersdir}/rpcbind.conf
%changelog
+* Wed Jul 1 2026 Steve Dickson <steved@redhat.com> 1.2.9-2
+- Fix leak of nconf in main()
+
* Tue Jun 30 2026 Scott Mayhew <smayhew@redhat.com> 1.2.9-1
- Renamed RPCBIND_ARGS to RPCBIND_OPTIONS in /etc/sysconfig/rpcbind
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-01 15:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-01 15:43 [rpms/rpcbind] f44: Fix leak of nconf in main() Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox