git: f0b58b190107 - main - rpcgen: Don't free() a pointer after realloc().
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 05 Dec 2022 00:32:19 UTC
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; }