pam: free conversation buffer on error (#30466)

As per pam_conv(3):

> On failure, the conversation function should release any resources
> it has allocated, and return one of the predefined PAM error codes.

Fixes gravitational/teleport-private#661
This commit is contained in:
Zac Bergquist
2023-08-15 21:22:30 +00:00
committed by GitHub
parent c9a8288920
commit c53b951016
+1
View File
@@ -111,6 +111,7 @@ int converse(int n, const struct pam_message **msg, struct pam_response **resp,
}
}
memset(aresp, 0, n * sizeof *aresp);
free(aresp);
*resp = NULL;
return PAM_CONV_ERR;
}