mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
login_getclassbyname(3): use calloc.
This commit is contained in:
parent
176d83eafc
commit
9df529b8a1
1 changed files with 1 additions and 4 deletions
|
|
@ -295,7 +295,7 @@ login_getclassbyname(char const *name, const struct passwd *pwd)
|
|||
{
|
||||
login_cap_t *lc;
|
||||
|
||||
if ((lc = malloc(sizeof(login_cap_t))) != NULL) {
|
||||
if ((lc = calloc(1, sizeof(login_cap_t))) != NULL) {
|
||||
int r, me, i = 0;
|
||||
uid_t euid = 0;
|
||||
gid_t egid = 0;
|
||||
|
|
@ -332,9 +332,6 @@ login_getclassbyname(char const *name, const struct passwd *pwd)
|
|||
login_dbarray[i++] = path_login_conf;
|
||||
login_dbarray[i] = NULL;
|
||||
|
||||
memset(lc, 0, sizeof(login_cap_t));
|
||||
lc->lc_cap = lc->lc_class = lc->lc_style = NULL;
|
||||
|
||||
if (name == NULL || *name == '\0')
|
||||
name = LOGIN_DEFCLASS;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue