git: 942525ab47e9 - main - bhyvectl: don't leak nvlist in send_message

From: Corvin Köhne <corvink_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 13:05:26 UTC
The branch main has been updated by corvink:

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

commit 942525ab47e9cd9277ac426e082366d58d7bbe41
Author:     Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2023-03-06 11:32:17 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-03-06 13:03:58 +0000

    bhyvectl: don't leak nvlist in send_message
    
    Reviewed by:            corvink, markj
    MFC after:              1 week
    Sponsored by:           vStack
    Differential Revision:  https://reviews.freebsd.org/D38900
---
 usr.sbin/bhyvectl/bhyvectl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index 59ecbebdfeae..4aa235e00489 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -1704,9 +1704,9 @@ send_message(const char *vmname, nvlist_t *nvl)
 		perror("nvlist_send() failed");
 		err = errno;
 	}
+done:
 	nvlist_destroy(nvl);
 
-done:
 	if (socket_fd >= 0)
 		close(socket_fd);
 	return (err);