aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-12-20 09:40:35 -0600
committerGitHub <noreply@github.com>2021-12-20 09:40:35 -0600
commitdd4a9738c6d66a7e4d9ab31527f8eb54ba621b19 (patch)
tree12fd2292652b5ccc8e31ff82773b6a8b5213b1ae
parent360467d0df626d2d0eac003a0a210814910804ce (diff)
parent546dd336d15251981bb8bcb30c159d0a39bb387e (diff)
Merge pull request #330 from google/avoid-warning
pam: avoid compiler warning in copyIntoSecret()
-rw-r--r--pam/pam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pam/pam.c b/pam/pam.c
index 1859a2f..1479dfa 100644
--- a/pam/pam.c
+++ b/pam/pam.c
@@ -93,7 +93,7 @@ void freeArray(pam_handle_t* pamh, void** array, int error_status) {
void* copyIntoSecret(void* data) {
size_t size = strlen(data) + 1; // include null terminator
- void* copy = malloc(size);
+ void* copy = calloc(1, size); // initialize to avoid a compiler warning
mlock(copy, size);
memcpy(copy, data, size);
return copy;