Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jul 2021 13:24:27 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e553299fd630 - stable/12 - libpfctl: memory leak fix
Message-ID:  <202107091324.169DORsm063472@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=e553299fd630d181401f9179aacca62682e2f26c

commit e553299fd630d181401f9179aacca62682e2f26c
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-06-30 11:02:35 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-07-09 08:08:39 +0000

    libpfctl: memory leak fix
    
    We must remember to free the nvlist we create from the kernel's response
    to DIOCGETSTATESNV, on every iteration.
    
    Reviewed by:    donner
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30957
    
    (cherry picked from commit 0e9f1892ec739d7fbd854af699507167a0a5dde2)
---
 lib/libpfctl/libpfctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
index 524e2472238e..bbb53edf8bc1 100644
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -727,6 +727,7 @@ pfctl_get_states(int dev, struct pfctl_states *states)
 			goto out;
 		}
 
+		nvlist_destroy(nvl);
 		nvl = nvlist_unpack(nv.data, nv.len, 0);
 		if (nvl == NULL) {
 			error = EIO;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107091324.169DORsm063472>