From 3f928b21486369c495d9eaca46eb9d506ae576b3 Mon Sep 17 00:00:00 2001
From: cgzones <cgzones@googlemail.com>
Date: Wed, 1 Nov 2023 20:35:40 +0100
Subject: [PATCH] lib: close audit socket in load_feature_bitmap() (#334)


Reference:https://github.com/linux-audit/audit-userspace/commit/3f928b21486369c495d9eaca46eb9d506ae576b3
Conflict:NA

---
 lib/libaudit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/libaudit.c b/lib/libaudit.c
index ded3ab47..4c317c87 100644
--- a/lib/libaudit.c
+++ b/lib/libaudit.c
@@ -657,12 +657,14 @@ static void load_feature_bitmap(void)
 
 				/* Found it... */
 				features_bitmap = rep.status->feature_bitmap;
+				audit_close(fd);
 				return;
 			}
 		}
 	}
 #endif
 	features_bitmap = AUDIT_FEATURES_UNSUPPORTED;
+	audit_close(fd);
 }
 
 uint32_t audit_get_features(void)
-- 
2.33.0

