]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
security_selinux: Declare internal autoptr cleanup helper for 'context_t'
authorPeter Krempa <pkrempa@redhat.com>
Fri, 18 Jul 2025 14:07:11 +0000 (16:07 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 22 Jul 2025 14:52:35 +0000 (16:52 +0200)
The selinux headers have a 'typedef context_s_t *context_t;' definition
in the header so we declare autoptr cleanup function for 'context_s_t'
and use it instead of 'context_t' definitions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/security/security_selinux.c

index f01a707c2825b4f842c69e7af999280ecdd6377e..87348f36fa62afc96045e6f19779f881c0a83dec 100644 (file)
@@ -48,6 +48,9 @@ VIR_LOG_INIT("security.security_selinux");
 
 #define MAX_CONTEXT 1024
 
+/* selinux headers define 'context_t' as pointer to 'context_s_t' */
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(context_s_t, context_free);
+
 typedef struct _virSecuritySELinuxData virSecuritySELinuxData;
 struct _virSecuritySELinuxData {
     char *domain_context;