summaryrefslogtreecommitdiffstats
path: root/api/src/gfapi.aliases
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-10-11 11:40:13 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-10-11 11:54:21 -0700
commitb07c5324161f2fda22d5903db61b9711cf949229 (patch)
treec2b586a3f5258dec93d45b0fc8c1809e75730024 /api/src/gfapi.aliases
parent11279aacbda1f05c3405a85583973f24ce20d103 (diff)
gfapi: warn when glfs_realpath() returned malloc'd memory
glfs_realpath() may return memory allocated with malloc(). Depending on the memory allocator that the application uses, calling free() on the returned string can cause segmentation faults or other problems. Functions that allocate memory, need to match the free'ing of the same memory allocator and memory accounting. glibc/malloc and jemalloc/free do not match together (other allocators could probably trigger these problems as well). Applications need to provide a pre-allocated buffer, or in case glfs_realpath() allocates the memory, glfs_free() should be used to free it. Cherry picked from commit 85e959052148ec481823d55c8b91cdee36da2b43: > Change-Id: I5d721a7425674aa700db8a7a436cbedb95a5927f > BUG: 1370931 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/15332 > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Change-Id: I5d721a7425674aa700db8a7a436cbedb95a5927f BUG: 1383591 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/15621 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'api/src/gfapi.aliases')
-rw-r--r--api/src/gfapi.aliases3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/gfapi.aliases b/api/src/gfapi.aliases
index ac89d35df6b..74ef4d3442d 100644
--- a/api/src/gfapi.aliases
+++ b/api/src/gfapi.aliases
@@ -82,7 +82,7 @@ _pub_glfs_fremovexattr _glfs_fremovexattr$GFAPI_3.4.0
_pub_glfs_getcwd _glfs_getcwd$GFAPI_3.4.0
_pub_glfs_chdir _glfs_chdir$GFAPI_3.4.0
_pub_glfs_fchdir _glfs_fchdir$GFAPI_3.4.0
-_pub_glfs_realpath _glfs_realpath$GFAPI_3.4.0
+_pub_glfs_realpath34 _glfs_realpath$GFAPI_3.4.0
_pub_glfs_posix_lock _glfs_posix_lock$GFAPI_3.4.0
_pub_glfs_dup _glfs_dup$GFAPI_3.4.0
@@ -153,5 +153,6 @@ _pub_glfs_upcall_inode_get_pobject _glfs_upcall_inode_get_pobject$GFAPI_3.7.16
_pub_glfs_upcall_inode_get_pstat _glfs_upcall_inode_get_pstat$GFAPI_3.7.16
_pub_glfs_upcall_inode_get_oldpobject _glfs_upcall_inode_get_oldpobject$GFAPI_3.7.16
_pub_glfs_upcall_inode_get_oldpstat _glfs_upcall_inode_get_oldpstat$GFAPI_3.7.16
+_pub_glfs_realpath _glfs_realpath$GFAPI_3.7.17
_pub_glfs_ipc _glfs_ipc$GFAPI_4.0.0