summaryrefslogtreecommitdiff
path: root/src/dged/path.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dged/path.h')
-rw-r--r--src/dged/path.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dged/path.h b/src/dged/path.h
index 6e11d6a..da62457 100644
--- a/src/dged/path.h
+++ b/src/dged/path.h
@@ -29,10 +29,12 @@ static char *expanduser(const char *path) {
}
static char *to_abspath(const char *path) {
+ char *exp = expanduser(path);
char *p = realpath(path, NULL);
if (p != NULL) {
+ free(exp);
return p;
} else {
- return strdup(path);
+ return exp;
}
}