From: Todd C. Miller Date: Sat, 5 Jan 2008 13:13:06 +0000 (+0000) Subject: Free up parser data structures in sudo_file_close(). X-Git-Tag: SUDO_1_7_0~256 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53aec6601e75bf84e51d9063d22566e508279eaf;p=sudo Free up parser data structures in sudo_file_close(). --- diff --git a/gram.c b/gram.c index a35796011..83f0a9f4b 100644 --- a/gram.c +++ b/gram.c @@ -726,7 +726,7 @@ init_parser(path, quiet) init_aliases(); efree(sudoers); - sudoers = estrdup(path); + sudoers = path ? estrdup(path) : NULL; parse_error = FALSE; errorlineno = -1; diff --git a/parse.c b/parse.c index fced5f372..5d65e333b 100644 --- a/parse.c +++ b/parse.c @@ -96,7 +96,8 @@ int sudo_file_close(nss) struct sudo_nss *nss; { - /* XXX - free up data structures */ + /* Free parser data structures and close sudoers file. */ + init_parser(NULL, 0); if (nss->handle != NULL) { fclose(nss->handle); nss->handle = NULL;