Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Dec 2022 00:32:19 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f0b58b190107 - main - rpcgen: Don't free() a pointer after realloc().
Message-ID:  <202212050032.2B50WJW3074302@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

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

commit f0b58b190107416e813c5db875034c6cfcede523
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-12-05 00:31:35 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-12-05 00:31:35 +0000

    rpcgen: Don't free() a pointer after realloc().
    
    A successful realloc() already frees the old pointer.
    
    Reported by:    GCC -Wuse-after-free
    Reviewed by:    brooks, imp, emaste
    Differential Revision:  https://reviews.freebsd.org/D37540
---
 usr.bin/rpcgen/rpc_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c
index 698017c969f2..1a2cae928472 100644
--- a/usr.bin/rpcgen/rpc_main.c
+++ b/usr.bin/rpcgen/rpc_main.c
@@ -925,7 +925,6 @@ moreargs(void)
 		warnx("unable to allocate arglist");
 		crash();
 	}
-	free(arglist);
 	arglist = newarglist;
 }
 



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