[PATCH 3/6] secilc: fix memory leaks in secilc2conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When specifying -o more than once, the previous allocation leaks.

Found by scan-build.

Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
---
 secilc/secil2conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/secilc/secil2conf.c b/secilc/secil2conf.c
index d4103777..c49522e5 100644
--- a/secilc/secil2conf.c
+++ b/secilc/secil2conf.c
@@ -111,6 +111,7 @@ int main(int argc, char *argv[])
 				qualified_names = 1;
 				break;
 			case 'o':
+				free(output);
 				output = strdup(optarg);
 				break;
 			case 'h':
-- 
2.32.0




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux