git: f4db390553ba - main - netmap tests: Reset ctx->nmctx to NULL in nmreq_parsing.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 05 Dec 2022 00:30:36 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f4db390553ba9db752865f5a42c36b062fdb03f2 commit f4db390553ba9db752865f5a42c36b062fdb03f2 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-12-05 00:29:25 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-12-05 00:29:25 +0000 netmap tests: Reset ctx->nmctx to NULL in nmreq_parsing. This avoids leaking a pointer to the on-stack test_nmctx which triggers a -Wdangling-pointer warning from GCC. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37536 --- tests/sys/netmap/ctrl-api-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/netmap/ctrl-api-test.c b/tests/sys/netmap/ctrl-api-test.c index 7cd4d6ac6d9b..8c87760217c3 100644 --- a/tests/sys/netmap/ctrl-api-test.c +++ b/tests/sys/netmap/ctrl-api-test.c @@ -1974,6 +1974,7 @@ nmreq_parsing(struct TestContext *ctx) ret = -1; } } + ctx->nmctx = NULL; return ret; }