From c859cfb399dc00dee24e02dd3acd40d40954c290 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 8 Jun 2021 15:06:30 +0200 Subject: tests/mock_pam.c: Don't leak memory pointed to by 'response'. --- tests/mock_pam.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') 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; -- cgit v1.2.3