[Bugs] [Bug 1383591] glfs_realpath() should not return malloc()' d allocated memory
bugzilla at redhat.com
bugzilla at redhat.com
Tue Oct 11 18:54:24 UTC 2016
https://bugzilla.redhat.com/show_bug.cgi?id=1383591
--- Comment #2 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: http://review.gluster.org/15621 committed in release-3.9 by Kaleb
KEITHLEY (kkeithle at redhat.com)
------
commit b07c5324161f2fda22d5903db61b9711cf949229
Author: Niels de Vos <ndevos at redhat.com>
Date: Tue Oct 11 11:40:13 2016 +0200
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 at redhat.com>
> Reviewed-on: http://review.gluster.org/15332
> CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
> Smoke: Gluster Build System <jenkins at build.gluster.org>
> NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
> Reviewed-by: Kaleb KEITHLEY <kkeithle at redhat.com>
Change-Id: I5d721a7425674aa700db8a7a436cbedb95a5927f
BUG: 1383591
Signed-off-by: Niels de Vos <ndevos at redhat.com>
Reviewed-on: http://review.gluster.org/15621
NetBSD-regression: NetBSD Build System <jenkins at build.gluster.org>
CentOS-regression: Gluster Build System <jenkins at build.gluster.org>
Smoke: Gluster Build System <jenkins at build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle at redhat.com>
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=taB7I7fz6Y&a=cc_unsubscribe
More information about the Bugs
mailing list