git: 2fb81691b02f - main - bhyve: Don't free an invalid pointer.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 03 Oct 2022 23:11:35 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=2fb81691b02f27fa938f311835a8c6704c5cf80f
commit 2fb81691b02f27fa938f311835a8c6704c5cf80f
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-10-03 23:10:44 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-10-03 23:10:44 +0000
bhyve: Don't free an invalid pointer.
The netmap-specific data stored at be->opaque is freed by the caller
on error as part of freeing be.
Reviewed by: markj
Reported by: GCC -Wfree-nonheap-object
Differential Revision: https://reviews.freebsd.org/D36828
---
usr.sbin/bhyve/net_backends.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/usr.sbin/bhyve/net_backends.c b/usr.sbin/bhyve/net_backends.c
index 0f1db7c8cfeb..adb3006f415b 100644
--- a/usr.sbin/bhyve/net_backends.c
+++ b/usr.sbin/bhyve/net_backends.c
@@ -695,7 +695,6 @@ netmap_init(struct net_backend *be, const char *devname,
if (priv->nmd == NULL) {
WPRINTF(("Unable to nm_open(): interface '%s', errno (%s)",
devname, strerror(errno)));
- free(priv);
return (-1);
}