aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 15:50:50 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 16:02:19 +0200
commit33871cdd77a9a3f4f0146bdd9aa2d05c4618efa6 (patch)
tree53bf8b5ad9f2d6b0d4ed0f72a50f10ee6b67cef9
parentc55139bfaabd3e5112486716f262936e85a2fb18 (diff)
downloadlibpam-freerdp2-33871cdd77a9a3f4f0146bdd9aa2d05c4618efa6.tar.gz
libpam-freerdp2-33871cdd77a9a3f4f0146bdd9aa2d05c4618efa6.tar.bz2
libpam-freerdp2-33871cdd77a9a3f4f0146bdd9aa2d05c4618efa6.zip
tests/mock_pam.c: Don't leak memory pointed to by 'response'.
-rw-r--r--tests/mock_pam.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/mock_pam.c b/tests/mock_pam.c
index e1b7324..71e0f71 100644
--- a/tests/mock_pam.c
+++ b/tests/mock_pam.c
@@ -42,8 +42,10 @@ int fake_conv (int __attribute__((unused)) num_msg,
response->resp = strdup ("password");
else if (strcmp((*msg)->msg, PAM_FREERDP2_PROMPT_DOMAIN) == 0)
response->resp = strdup ("domain");
- else
+ else {
+ free(response);
return PAM_SYMBOL_ERR; /* leaks... */
+ }
*resp = response;
@@ -73,8 +75,10 @@ int fake_conv_empty_password (int __attribute__((unused)) num_msg,
response->resp = strdup ("");
else if (strcmp((*msg)->msg, PAM_FREERDP2_PROMPT_DOMAIN) == 0)
response->resp = strdup ("domain");
- else
+ else {
+ free(response);
return PAM_SYMBOL_ERR; /* leaks... */
+ }
*resp = response;