summaryrefslogtreecommitdiff
path: root/auth-pam.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-06-02 08:07:31 +1000
committerDarren Tucker <dtucker@zip.com.au>2013-06-02 08:07:31 +1000
commitf60845fde29cead9d75e812db1c04916b4c58ffd (patch)
treea69fe76f6dd73057e46625867d1b4282e8a5a040 /auth-pam.c
parent12f6533215c0a36ab29d11ff52a853fce45573b4 (diff)
downloadopenssh-git-f60845fde29cead9d75e812db1c04916b4c58ffd.tar.gz
- (dtucker) [M auth-chall.c auth-krb5.c auth-pam.c cipher-aes.c cipher-ctr.c
groupaccess.c loginrec.c monitor.c monitor_wrap.c session.c sshd.c sshlogin.c uidswap.c openbsd-compat/bsd-cygwin_util.c openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/port-aix.c openbsd-compat/port-linux.c] Replace portable-specific instances of xfree with the equivalent calls to free.
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 675006e6..d51318b3 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -412,10 +412,9 @@ sshpam_thread_conv(int n, sshpam_const struct pam_message **msg,
fail:
for(i = 0; i < n; i++) {
- if (reply[i].resp != NULL)
- xfree(reply[i].resp);
+ free(reply[i].resp);
}
- xfree(reply);
+ free(reply);
buffer_free(&buffer);
return (PAM_CONV_ERR);
}
@@ -586,10 +585,9 @@ sshpam_store_conv(int n, sshpam_const struct pam_message **msg,
fail:
for(i = 0; i < n; i++) {
- if (reply[i].resp != NULL)
- xfree(reply[i].resp);
+ free(reply[i].resp);
}
- xfree(reply);
+ free(reply);
return (PAM_CONV_ERR);
}
@@ -693,7 +691,7 @@ sshpam_init_ctx(Authctxt *authctxt)
/* Start the authentication thread */
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, socks) == -1) {
error("PAM: failed create sockets: %s", strerror(errno));
- xfree(ctxt);
+ free(ctxt);
return (NULL);
}
ctxt->pam_psock = socks[0];
@@ -703,7 +701,7 @@ sshpam_init_ctx(Authctxt *authctxt)
strerror(errno));
close(socks[0]);
close(socks[1]);
- xfree(ctxt);
+ free(ctxt);
return (NULL);
}
cleanup_ctxt = ctxt;
@@ -742,7 +740,7 @@ sshpam_query(void *ctx, char **name, char **info,
strlcpy(**prompts + plen, msg, len - plen);
plen += mlen;
**echo_on = (type == PAM_PROMPT_ECHO_ON);
- xfree(msg);
+ free(msg);
return (0);
case PAM_ERROR_MSG:
case PAM_TEXT_INFO:
@@ -753,7 +751,7 @@ sshpam_query(void *ctx, char **name, char **info,
plen += mlen;
strlcat(**prompts + plen, "\n", len - plen);
plen++;
- xfree(msg);
+ free(msg);
break;
case PAM_ACCT_EXPIRED:
sshpam_account_status = 0;
@@ -766,7 +764,7 @@ sshpam_query(void *ctx, char **name, char **info,
*num = 0;
**echo_on = 0;
ctxt->pam_done = -1;
- xfree(msg);
+ free(msg);
return 0;
}
/* FALLTHROUGH */
@@ -776,7 +774,7 @@ sshpam_query(void *ctx, char **name, char **info,
debug("PAM: %s", **prompts);
buffer_append(&loginmsg, **prompts,
strlen(**prompts));
- xfree(**prompts);
+ free(**prompts);
**prompts = NULL;
}
if (type == PAM_SUCCESS) {
@@ -790,7 +788,7 @@ sshpam_query(void *ctx, char **name, char **info,
*num = 0;
**echo_on = 0;
ctxt->pam_done = 1;
- xfree(msg);
+ free(msg);
return (0);
}
error("PAM: %s for %s%.100s from %.100s", msg,
@@ -801,7 +799,7 @@ sshpam_query(void *ctx, char **name, char **info,
default:
*num = 0;
**echo_on = 0;
- xfree(msg);
+ free(msg);
ctxt->pam_done = -1;
return (-1);
}
@@ -852,7 +850,7 @@ sshpam_free_ctx(void *ctxtp)
debug3("PAM: %s entering", __func__);
sshpam_thread_cleanup();
- xfree(ctxt);
+ free(ctxt);
/*
* We don't call sshpam_cleanup() here because we may need the PAM
* handle at a later stage, e.g. when setting up a session. It's
@@ -1006,10 +1004,9 @@ sshpam_tty_conv(int n, sshpam_const struct pam_message **msg,
fail:
for(i = 0; i < n; i++) {
- if (reply[i].resp != NULL)
- xfree(reply[i].resp);
+ free(reply[i].resp);
}
- xfree(reply);
+ free(reply);
return (PAM_CONV_ERR);
}
@@ -1081,7 +1078,7 @@ do_pam_putenv(char *name, char *value)
snprintf(compound, len, "%s=%s", name, value);
ret = pam_putenv(sshpam_handle, compound);
- xfree(compound);
+ free(compound);
#endif
return (ret);
@@ -1108,8 +1105,8 @@ free_pam_environment(char **env)
return;
for (envp = env; *envp; envp++)
- xfree(*envp);
- xfree(env);
+ free(*envp);
+ free(env);
}
/*
@@ -1165,10 +1162,9 @@ sshpam_passwd_conv(int n, sshpam_const struct pam_message **msg,
fail:
for(i = 0; i < n; i++) {
- if (reply[i].resp != NULL)
- xfree(reply[i].resp);
+ free(reply[i].resp);
}
- xfree(reply);
+ free(reply);
return (PAM_CONV_ERR);
}