public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Steve Dickson <steved@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpcbind] f44: Fix leak of nconf in main()
Date: Wed, 01 Jul 2026 15:43:06 GMT	[thread overview]
Message-ID: <178292058695.1.1046668996218837290.rpms-rpcbind-e3a79e2cb3d6@fedoraproject.org> (raw)

            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
 

                 reply	other threads:[~2026-07-01 15:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178292058695.1.1046668996218837290.rpms-rpcbind-e3a79e2cb3d6@fedoraproject.org \
    --to=steved@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox