aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt2
-rw-r--r--ports/unix/guts/realpath.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index cf098ed..54567ca 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -2,6 +2,8 @@
* (seebs) use PSEUDO_STATBUF and base_lstat in path resolution, because
plain lstat can fail on XFS if an inode number is out of the 32-bit
range.
+ * (seebs) if no pointer was provided to realpath, provide allocated
+ dup.
2015-08-24:
* (seebs) drop unused/unimplemented "picky_fchmodat", since I
diff --git a/ports/unix/guts/realpath.c b/ports/unix/guts/realpath.c
index 48b2b34..a59808d 100644
--- a/ports/unix/guts/realpath.c
+++ b/ports/unix/guts/realpath.c
@@ -20,7 +20,7 @@
memcpy(resolved_name, rname, len + 1);
rc = resolved_name;
} else {
- rc = rname;
+ rc = strdup(rname);
}
/* return rc;