MFC rev. 1.6

Fix incorrect handling of malloc failures

PR:		bin/83369
This commit is contained in:
Matteo Riondato 2008-03-30 19:57:23 +00:00
parent b8c6fb47f8
commit e86d3565be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/7/; revision=177755

View File

@ -67,7 +67,9 @@ xencrypt(secret, passwd)
int len;
len = strlen(secret) / 2;
buf = malloc((unsigned)len);
if ((buf = malloc((unsigned)len)) == NULL) {
return(0);
}
hex2bin(len, secret, buf);
passwd2des(passwd, key);
@ -100,7 +102,9 @@ xdecrypt(secret, passwd)
int len;
len = strlen(secret) / 2;
buf = malloc((unsigned)len);
if ((buf = malloc((unsigned)len)) == NULL) {
return(0);
}
hex2bin(len, secret, buf);
passwd2des(passwd, key);