summaryrefslogtreecommitdiffstats
path: root/pw/pwupd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/pwupd.c')
-rw-r--r--pw/pwupd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/pw/pwupd.c b/pw/pwupd.c
index 4ab0f01..0f2df7a 100644
--- a/pw/pwupd.c
+++ b/pw/pwupd.c
@@ -56,12 +56,10 @@ setpwdir(const char * dir)
{
if (dir == NULL)
return -1;
- else {
- char * d = malloc(strlen(dir)+1);
- if (d == NULL)
- return -1;
- pwpath = strcpy(d, dir);
- }
+ else
+ pwpath = strdup(dir);
+ if (pwpath == NULL)
+ return -1;
return 0;
}