summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-01-19 15:09:51 -0800
committerSteven Danneman <steven.danneman@isilon.com>2009-01-21 17:13:03 -0800
commit989ad44d32c2e77972a966d91f1813b0b929f83b (patch)
treebb7a41c961fe974f464f7ce2a27ca3bf055187bf /source3/auth
parente9615b43b4dc7037da7bc274d720b8e54c7f85bc (diff)
downloadsamba-989ad44d32c2e77972a966d91f1813b0b929f83b.tar.gz
Memory leaks and other fixes found by Coverity
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/pampass.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c
index 9345eed27af..4312b771c95 100644
--- a/source3/auth/pampass.c
+++ b/source3/auth/pampass.c
@@ -462,7 +462,9 @@ static bool smb_pam_end(pam_handle_t *pamh, struct pam_conv *smb_pam_conv_ptr)
static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rhost, struct pam_conv *pconv)
{
int pam_error;
+#ifdef PAM_RHOST
const char *our_rhost;
+#endif
char addr[INET6_ADDRSTRLEN];
*pamh = (pam_handle_t *)NULL;
@@ -475,6 +477,7 @@ static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rho
return False;
}
+#ifdef PAM_RHOST
if (rhost == NULL) {
our_rhost = client_name(get_client_fd());
if (strequal(our_rhost,"UNKNOWN"))
@@ -483,7 +486,6 @@ static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rho
our_rhost = rhost;
}
-#ifdef PAM_RHOST
DEBUG(4,("smb_pam_start: PAM: setting rhost to: %s\n", our_rhost));
pam_error = pam_set_item(*pamh, PAM_RHOST, our_rhost);
if(!smb_pam_error_handler(*pamh, pam_error, "set rhost failed", 0)) {