diff --git a/lib/getdef.c b/lib/getdef.c index 383cf3f4a..56731feb1 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -453,13 +453,9 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name, cons void setdef_config_file (const char* file) { #ifdef USE_ECONF - char *cp; - - cp = xaprintf("%s/%s", file, sysconfdir); - sysconfdir = cp; + sysconfdir = xaprintf("%s/%s", file, sysconfdir); #ifdef VENDORDIR - cp = xaprintf("%s/%s", file, vendordir); - vendordir = cp; + vendordir = xaprintf("%s/%s", file, vendordir); #endif #else def_fname = file; diff --git a/src/su.c b/src/su.c index c9b7494f8..a55d94062 100644 --- a/src/su.c +++ b/src/su.c @@ -1204,15 +1204,12 @@ int main (int argc, char **argv) * case they will be provided to the new user's shell as arguments. */ if (fakelogin) { - char *arg0; - cp = getdef_str ("SU_NAME"); if (NULL == cp) { cp = Basename (shellstr); } - arg0 = xaprintf("-%s", cp); - cp = arg0; + cp = xaprintf("-%s", cp); } else { cp = Basename (shellstr); } diff --git a/src/useradd.c b/src/useradd.c index 3adf2e1f1..e88d59679 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -444,14 +444,10 @@ get_defaults(void) if (streq(ccp, "")) ccp = SKEL_DIR; - if (prefix[0]) { - char *dt; - - dt = xaprintf("%s/%s", prefix, ccp); - def_template = dt; - } else { + if (prefix[0]) + def_template = xaprintf("%s/%s", prefix, ccp); + else def_template = xstrdup(ccp); - } } /* diff --git a/src/usermod.c b/src/usermod.c index fba1c4af9..a64757947 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -427,15 +427,12 @@ usage (int status) static char *new_pw_passwd (char *pw_pass) { if (Lflg && ('!' != pw_pass[0])) { - char *buf; - #ifdef WITH_AUDIT audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "updating passwd", user_newname, user_newid, 0); #endif SYSLOG ((LOG_INFO, "lock user '%s' password", user_newname)); - buf = xaprintf("!%s", pw_pass); - pw_pass = buf; + pw_pass = xaprintf("!%s", pw_pass); } else if (Uflg && pw_pass[0] == '!') { if (pw_pass[1] == '\0') { fprintf (stderr,