Add missing globfree(3) in command_matches_glob() when matching a directory.

This commit is contained in:
Todd C. Miller
2021-02-21 13:35:00 -07:00
parent 387169ac67
commit ecbe95589a

View File

@@ -464,8 +464,10 @@ command_matches_glob(const char *sudoers_cmnd, const char *sudoers_args,
/* If it ends in '/' it is a directory spec. */
dlen = strlen(cp);
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);
}
continue;
}