Blob Blame History Raw
From 6924b8f8d82ecd32e897cf5f441e5c87f8816859 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Thu, 22 Jul 2021 11:29:20 +0200
Subject: [PATCH] lib: avoid freeing uninitialized variable in
 authselect_apply_changes()

If authselect_profile() fails, we goto done and try to free uninitialized
variable.

Resolves:
https://github.com/authselect/authselect/issues/265
---
 src/lib/authselect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/authselect.c b/src/lib/authselect.c
index 0f43e12202c16769dfc6ac7dee41812159cc1d3a..a901e02719713bd13d5a4fab606ee713b3d6ddca 100644
--- a/src/lib/authselect.c
+++ b/src/lib/authselect.c
@@ -163,7 +163,7 @@ authselect_uninstall(void)
 _PUBLIC_ int
 authselect_apply_changes(void)
 {
-    struct authselect_profile *profile;
+    struct authselect_profile *profile = NULL;
     char **supported = NULL;
     char *profile_id;
     char **features;
-- 
2.31.1