mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-30 22:05:27 +00:00
Fix gcc warning about possible uninitialized use of the ms variable; if
match_string is NULL, the out: cleanup will test ms for !NULL and free it, even though it hasn't been initialized.
This commit is contained in:
@@ -341,11 +341,13 @@ int have_enough_privilege(void)
|
||||
command line, or the kernel supplied a match string */
|
||||
static void get_match_string(void) {
|
||||
|
||||
FILE *ms = NULL;
|
||||
|
||||
/* has process_args() already assigned a match string? */
|
||||
if (match_string)
|
||||
goto out;
|
||||
|
||||
FILE *ms = fopen(MATCH_STRING, "r");
|
||||
ms = fopen(MATCH_STRING, "r");
|
||||
if (!ms)
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user