Plugged some small memory leaks
[pspp-builds.git] / src / data / file-name.c
index 3216ef09fb98d155137510f31f683deb9152adf9..97d75e48175b49a9d35d5f9195b8cc3e0743a8ca 100644 (file)
@@ -146,7 +146,7 @@ fn_tilde_expand (const char *input)
           pwd = getpwnam (ds_cstr (&user_name));
           if (pwd != NULL && pwd->pw_dir[0] != '\0')
             {
-              home = pwd->pw_dir;
+              home = xstrdup (pwd->pw_dir);
               remainder = input + 1 + ds_length (&user_name);
             }
           ds_destroy (&user_name);