Commit 83445eb9 authored by Jim Meyering's avatar Jim Meyering Committed by David Zeuthen
Browse files

remove unnecessary strdup.



* src/polkit-grant/polkit-grant-helper-shadow.c (do_auth):
Signed-off-by: default avatarJim Meyering <meyering@redhat.com>
Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 798208df
......@@ -126,7 +126,6 @@ error:
int do_auth (const char *user_to_auth)
{
struct spwd *shadow;
char *password;
char buf[256];
if ((shadow = getspnam (user_to_auth)) == NULL)
......@@ -139,9 +138,7 @@ int do_auth (const char *user_to_auth)
buf[strlen (buf) - 1] == '\n')
buf[strlen (buf) - 1] = '\0';
password = strdup (buf);
if (strcmp (shadow->sp_pwdp, crypt (password, shadow->sp_pwdp)) != 0)
if (strcmp (shadow->sp_pwdp, crypt (buf, shadow->sp_pwdp)) != 0)
goto error;
return 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment