2
0
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:
Steve Beattie
2007-07-18 14:22:59 +00:00
parent 74b0f0b5ad
commit a6f387a17e

View File

@@ -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;