aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 15:06:30 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-06-08 15:28:51 +0200
commitc859cfb399dc00dee24e02dd3acd40d40954c290 (patch)
tree0179e9fc91f2103afc82f4b0b4529b21d2365132 /tests
parentf8e02042cf5392278c41e4714fc051175da8f7fd (diff)
downloadlibpam-x2go-c859cfb399dc00dee24e02dd3acd40d40954c290.tar.gz
libpam-x2go-c859cfb399dc00dee24e02dd3acd40d40954c290.tar.bz2
libpam-x2go-c859cfb399dc00dee24e02dd3acd40d40954c290.zip
tests/mock_pam.c: Don't leak memory pointed to by 'response'.
Diffstat (limited to 'tests')
-rw-r--r--tests/mock_pam.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/mock_pam.c b/tests/mock_pam.c
index 10f2d80..88dc8d6 100644
--- a/tests/mock_pam.c
+++ b/tests/mock_pam.c
@@ -45,7 +45,10 @@ int fake_conv (int __attribute__((unused)) num_msg,
else if (strcmp((*msg)->msg, PAM_X2GO_PROMPT_COMMAND) == 0)
response->resp = strdup ("rcommand");
else
+ {
+ free(response);
return PAM_SYMBOL_ERR; /* leaks... */
+ }
*resp = response;