aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-12 16:56:52 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-12 16:56:52 +0000
commitfdddab0c61c55c25d4218d4370e2b16a7936a794 (patch)
treebf93480018a52ab051189222248b6d04af98d7d4 /libbb/pw_encrypt.c
parent4ea83bf562c44a6792e7c77e7d87cba91f86f763 (diff)
downloadbusybox-fdddab0c61c55c25d4218d4370e2b16a7936a794.tar.gz
make pw_encrypt() return malloc'ed string.
text data bss dec hex filename 759802 604 6684 767090 bb472 busybox_old 759804 604 6676 767084 bb46c busybox_unstripped
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)
char *pw_encrypt(const char *clear, const char *salt, int cleanup)
{
- static char *cipher;
+ char *encrypted;
#if 0 /* was CONFIG_FEATURE_SHA1_PASSWORDS, but there is no such thing??? */
if (strncmp(salt, "$2$", 3) == 0) {
@@ -62,11 +62,10 @@ char *pw_encrypt(const char *clear, const char *salt, int cleanup)
}
#endif
- free(cipher);
- cipher = my_crypt(clear, salt);
+ encrypted = my_crypt(clear, salt);
if (cleanup)
my_crypt_cleanup();
- return cipher;
+ return encrypted;
}