Add missing globfree(3) in command_matches_glob() when matching a directory.
This commit is contained in:
@@ -464,8 +464,10 @@ command_matches_glob(const char *sudoers_cmnd, const char *sudoers_args,
|
|||||||
/* If it ends in '/' it is a directory spec. */
|
/* If it ends in '/' it is a directory spec. */
|
||||||
dlen = strlen(cp);
|
dlen = strlen(cp);
|
||||||
if (cp[dlen - 1] == '/') {
|
if (cp[dlen - 1] == '/') {
|
||||||
if (command_matches_dir(cp, dlen, runchroot, digests))
|
if (command_matches_dir(cp, dlen, runchroot, digests)) {
|
||||||
|
globfree(&gl);
|
||||||
debug_return_bool(true);
|
debug_return_bool(true);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user