Call cleanup() before exit in log_error() instead of calling
sudo_ldap_close() directly. ldap_conn can now be static to sudo.c
This commit is contained in:
@@ -394,10 +394,7 @@ log_error(flags, fmt, va_alist)
|
||||
efree(logline);
|
||||
|
||||
if (!ISSET(flags, NO_EXIT)) {
|
||||
#ifdef HAVE_LDAP
|
||||
if (ldap_conn != NULL)
|
||||
sudo_ldap_close(ldap_conn);
|
||||
#endif
|
||||
cleanup(0);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
2
sudo.c
2
sudo.c
@@ -150,7 +150,7 @@ char *login_style;
|
||||
sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp, saved_sa_chld;
|
||||
static char *runas_user;
|
||||
static char *runas_group;
|
||||
void *ldap_conn;
|
||||
static void *ldap_conn;
|
||||
|
||||
int
|
||||
main(argc, argv, envp)
|
||||
|
Reference in New Issue
Block a user