diff options
author | Anand Avati <avati@gluster.com> | 2011-05-20 16:56:28 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-05-30 04:48:48 -0700 |
commit | fa19eabd89c0efc52830ad5f6ac63285175acce7 (patch) | |
tree | 3290d3033bf03bbf98b9295324c172b9690e5cae /xlators/performance/read-ahead | |
parent | 80b84f4b852c2794c46af4de1e8ab48673163dc3 (diff) |
stat-prefetch: fix dirname(3) usage
glibc dirname() modify the string it is given and returns it.
glusterfs takes this behavior for granted, and assume that if it
gives a malloc'ed string to dirname(), then it can free()) the
return value.
Here is what SUSv2 says:
http://opengroup.org/onlinepubs/007908799/xsh/dirname.html
"The dirname() function may modify the string pointed to by path,
and may return a pointer to static storage"
At least NetBSD returns a static storage. glusterfs will return it to
a calling function that has the responsability to free it, causing
a SIGSEGV.
Thanks to: Emmanuel Dreyfus <manu@netbsd.org>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2923 (NetBSD port)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2923
Diffstat (limited to 'xlators/performance/read-ahead')
0 files changed, 0 insertions, 0 deletions