diff options
author | K.Takata <kentkt@csc.jp> | 2022-01-19 13:32:57 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-19 13:32:57 +0000 |
commit | 1a8825d7a3484d76ca16ea2aa9769cadca7758a4 (patch) | |
tree | 3fa19e87656a4a3ef97ad6fc4635719c841d24c9 /src/buffer.c | |
parent | b0b2b73dca40c26ff1f4befe5c3aad3fd4bccfad (diff) |
patch 8.2.4144: cannot load libsodium dynamicallyv8.2.4144
Problem: Cannot load libsodium dynamically.
Solution: Support dynamic loading on MS-Windows. (Ken Takata, closes #9554)
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index 08db0fc28e..18aa2a09e7 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2269,8 +2269,9 @@ free_buf_options( #endif #ifdef FEAT_CRYPT # ifdef FEAT_SODIUM - if (buf->b_p_key != NULL && (crypt_get_method_nr(buf) == CRYPT_M_SOD)) - sodium_munlock(buf->b_p_key, STRLEN(buf->b_p_key)); + if ((buf->b_p_key != NULL) && (*buf->b_p_key != NUL) && + (crypt_get_method_nr(buf) == CRYPT_M_SOD)) + crypt_sodium_munlock(buf->b_p_key, STRLEN(buf->b_p_key)); # endif clear_string_option(&buf->b_p_key); #endif |