summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-10-12 12:44:13 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-10-28 04:40:08 -0700
commitfbeefb873a1b9103e1c6449b64c172aa4654addd (patch)
tree275857768d0de50836c828c6ccc3183d587b3aa9 /xlators/mgmt
parent24adb0607683cfec784933f332252a4cd53b8cb7 (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: 1383593 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/15628 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/mgmt')
0 files changed, 0 insertions, 0 deletions