aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-12-10 17:13:52 +0100
committerMichael Adam <obnox@samba.org>2015-12-10 22:54:52 +0100
commit776a18460f3e259a12a8b07ee52d70676fdb7258 (patch)
tree4f962bf18c4bf6d1c855bb6dc6319846e3af66e6
parent927a070eb6d80fb155ccc033704522d336789c28 (diff)
downloadpam_wrapper-776a18460f3e259a12a8b07ee52d70676fdb7258.tar.gz
pam_wrapper-776a18460f3e259a12a8b07ee52d70676fdb7258.tar.xz
pam_wrapper-776a18460f3e259a12a8b07ee52d70676fdb7258.zip
libpamtest: Do not call pam_end() if tc is not set
This fixes a build warning. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--src/libpamtest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libpamtest.c b/src/libpamtest.c
index 98192ce..6d6efc6 100644
--- a/src/libpamtest.c
+++ b/src/libpamtest.c
@@ -70,7 +70,7 @@ enum pamtest_err _pamtest_conv(const char *service,
pam_handle_t *ph;
struct pam_conv conv;
size_t tcindex;
- struct pam_testcase *tc;
+ struct pam_testcase *tc = NULL;
bool call_pam_end = true;
conv.conv = conv_fn;
@@ -101,7 +101,7 @@ enum pamtest_err _pamtest_conv(const char *service,
}
}
- if (call_pam_end == true) {
+ if (call_pam_end == true && tc != NULL) {
rv = pam_end(ph, tc->op_rv);
if (rv != PAM_SUCCESS) {
return PAMTEST_ERR_END;