diff options
author | Niels de Vos <ndevos@redhat.com> | 2016-09-13 09:03:56 +0200 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-10-11 00:14:00 -0700 |
commit | 85e959052148ec481823d55c8b91cdee36da2b43 (patch) | |
tree | 18c1d1c977912a58a6b9dbfe9ec99325ae262d40 /api/src/gfapi.map | |
parent | 2e23c62cc50037c8e61bcd9c04348409e7627181 (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.
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>
Diffstat (limited to 'api/src/gfapi.map')
-rw-r--r-- | api/src/gfapi.map | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/src/gfapi.map b/api/src/gfapi.map index bd7ff13fe41..1ae6d4665fc 100644 --- a/api/src/gfapi.map +++ b/api/src/gfapi.map @@ -188,6 +188,11 @@ GFAPI_3.7.16 { glfs_upcall_inode_get_oldpstat; } GFAPI_3.7.15; +GFAPI_3.7.17 { + global: + glfs_realpath; +} GFAPI_3.7.16; + GFAPI_4.0.0 { global: glfs_ipc; |