diff --git a/lrzip.c b/lrzip.c index dd0998a..dce63af 100644 --- a/lrzip.c +++ b/lrzip.c @@ -509,7 +509,8 @@ static void release_hashes(rzip_control *control) { memset(control->salt_pass, 0, PASS_LEN); memset(control->hash, 0, SALT_LEN); - munlockall(); + munlock(control->salt_pass, PASS_LEN); + munlock(control->hash, HASH_LEN); free(control->salt_pass); free(control->hash); } diff --git a/lrzip_private.h b/lrzip_private.h index e04456b..492f3f8 100644 --- a/lrzip_private.h +++ b/lrzip_private.h @@ -90,7 +90,8 @@ typedef uint32_t u32; typedef struct rzip_control rzip_control; typedef struct md5_ctx md5_ctx; -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ + defined(__APPLE__) || defined(__CYGWIN__) #define mremap fake_mremap #endif