aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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;