about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/wordexp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sysdeps/generic/wordexp.c b/sysdeps/generic/wordexp.c
index dcd724ef4f..ce81ef1910 100644
--- a/sysdeps/generic/wordexp.c
+++ b/sysdeps/generic/wordexp.c
@@ -346,7 +346,7 @@ parse_tilde (char **word, size_t *word_length, size_t *max_length,
   else
     {
       /* Look up user name in database to get home directory */
-      char *user = __strndup (&words[1 + *offset], i - (1 + *offset));
+      char *user = strndupa (&words[1 + *offset], i - (1 + *offset));
       struct passwd pwd, *tpwd;
       int buflen = 1000;
       char* buffer = __alloca (buflen);
@@ -370,7 +370,6 @@ parse_tilde (char **word, size_t *word_length, size_t *max_length,
 	}
 
       *offset = i - 1;
-      free (user);
     }
   return *word ? 0 : WRDE_NOSPACE;
 }