aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/pw_encrypt.c')
-rw-r--r--libbb/pw_encrypt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index d439fc3b4..762cbab27 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -54,7 +54,7 @@ static void my_crypt_cleanup(void)
54 54
55char *pw_encrypt(const char *clear, const char *salt, int cleanup) 55char *pw_encrypt(const char *clear, const char *salt, int cleanup)
56{ 56{
57 static char *cipher; 57 char *encrypted;
58 58
59#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */ 59#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */
60 if (strncmp(salt, "$2$", 3) == 0) { 60 if (strncmp(salt, "$2$", 3) == 0) {
@@ -62,11 +62,10 @@ char *pw_encrypt(const char *clear, const char *salt, int cleanup)
62 } 62 }
63#endif 63#endif
64 64
65 free(cipher); 65 encrypted = my_crypt(clear, salt);
66 cipher = my_crypt(clear, salt);
67 66
68 if (cleanup) 67 if (cleanup)
69 my_crypt_cleanup(); 68 my_crypt_cleanup();
70 69
71 return cipher; 70 return encrypted;
72} 71}