bugzilla-daemon at bugzilla.mindrot.org
2018-Dec-04 16:09 UTC
[Bug 2938] New: minor memory leak during channel_init_channels()
https://bugzilla.mindrot.org/show_bug.cgi?id=2938
Bug ID: 2938
Summary: minor memory leak during channel_init_channels()
Product: Portable OpenSSH
Version: 7.9p1
Hardware: ix86
OS: All
Status: NEW
Severity: trivial
Priority: P5
Component: ssh
Assignee: unassigned-bugs at mindrot.org
Reporter: markus at blueflash.cc
Created attachment 3208
--> https://bugzilla.mindrot.org/attachment.cgi?id=3208&action=edit
patch to fix memory leak
Note: This is my first contribution to the openssh source and I'm
porting my findings from a macOS/Windows port back to the original
source. So please be gentle with my possible wrongdoings and errors.
In any case, I think this should be pretty straightforward:
In channels.c there is the channel_init_channels() function, which
initially callocates memory for the sc structure and immediately also
callocates and fills the sc->channel_pre and sc->channel_post pointer
members.
Then, after a few lines of code, it finally calls the
channel_handler_init(sc) function.
Now, the channel channel_handler_init() also callocates memory for pre
and post and finally assigns its pointers into the sc struct pointer
members.
sc->channel_pre = pre;
sc->channel_post = post;
However, at this point, sc->channel_pre and sc->channel_post are
already filled with the pointers to the memory blocks which
channel_init_channels() had allocated.
Thus these pointers get lost and the memory blocks leak.
Proposal: don't have chanell_init_channel() allocate these. Let
channel_init_channels() do it.
A patch is attached.
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Dec-04 16:13 UTC
[Bug 2938] minor memory leak during channel_init_channels()
https://bugzilla.mindrot.org/show_bug.cgi?id=2938
Markus <markus at blueflash.cc> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |markus at blueflash.cc
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Dec-07 02:21 UTC
[Bug 2938] minor memory leak during channel_init_channels()
https://bugzilla.mindrot.org/show_bug.cgi?id=2938
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |djm at mindrot.org
Attachment #3208|0 |1
is patch| |
Attachment #3208|application/octet-stream |text/plain
mime type| |
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Dec-07 02:31 UTC
[Bug 2938] minor memory leak during channel_init_channels()
https://bugzilla.mindrot.org/show_bug.cgi?id=2938
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |2915
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #1 from Damien Miller <djm at mindrot.org> ---
Good catch - thanks! I've committed this and it will be in the
openssh-8.0 release.
Referenced Bugs:
https://bugzilla.mindrot.org/show_bug.cgi?id=2915
[Bug 2915] Tracking bug for 8.0 release
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2019-May-03 04:42 UTC
[Bug 2938] minor memory leak during channel_init_channels()
https://bugzilla.mindrot.org/show_bug.cgi?id=2938
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #2 from Damien Miller <djm at mindrot.org> ---
Move resolved bugs -> CLOSED after 8.0 release
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2021-Oct-13 14:42 UTC
[Bug 2938] minor memory leak during channel_init_channels()
https://bugzilla.mindrot.org/show_bug.cgi?id=2938
Ahmed Sayeed <ahmedsayeed1982 at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ahmedsayeed1982 at yahoo.com
--- Comment #3 from Ahmed Sayeed <ahmedsayeed1982 at yahoo.com> ---
ake: Entering directory '/home/Christian/binutils-gdb/cygwin-obj/gdb'
CXXLD gdb.exe http://www.compilatori.com/computers/smartphones/
cp-support.o: in function `gdb_demangle(char const*, int)':
http://www.acpirateradio.co.uk/services/ios15/
/home/Christian/binutils-gdb/cygwin-obj/gdb/../../gdb/cp-support.c:1619:(.text+0x5502):
http://www.logoarts.co.uk/property/lidar-sensor/ relocation truncated
to fit: R_X86_64_PC32 against undefined symbol
http://www.slipstone.co.uk/property/hp-of-cars/ `TLS init function for
thread_local_segv_handler'
/home/Christian/binutils-gdb/cygwin-obj/gdb/../../gdb/cp-support.c:1619:(.text+0x551b):
http://embermanchester.uk/property/chat-themes/ relocation truncated
to fit: R_X86_64_PC32 against undefined symbol `TLS init function for
thread_local_segv_handler'
collect2: error: ld returned 1 exit status
http://connstr.net/property/mars-researches/
make: *** [Makefile:1881: gdb.exe] Error 1
make: Leaving directory '/home/Christian/binutils-gdb/cygwin-obj/gdb'
http://joerg.li/services/kia-rio-price/
$ g++ -v
Using built-in specs.
http://www.jopspeech.com/technology/thunderbolt-4/
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/10/lto-wrapper.exe
Target: x86_64-pc-cygwin
http://www.wearelondonmade.com/tech/driving-assistant/
Configured with:
/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-10.2.0/configure
--srcdir=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-10.2.0 --prefix=/usr
--exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
--docdir=/usr/share/doc/gcc --
https://waytowhatsnext.com/computers/discord-and-steam/
htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin
--host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix --
http://www.iu-bloomington.com/property/properties-in-turkey/
libexecdir=/usr/lib --with-gcc-major-version-only --enable-shared
--enable-shared-libgcc --enable-static
--enable-version-specific-runtime-libs --enable-bootstrap
--enable-__cxa_atexit --with-dwarf2
https://komiya-dental.com/sports/telegram/ --with-tune=generic
--enable-languages=c,c++,fortran,lto,objc,obj-c++ --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp
--enable-libquadmath http://www-look-4.com/health/winter-sickness/
--enable-libquadmath-support --disable-libssp --enable-libada
--disable-symvers --with-gnu-ld --with-gnu-as
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix
--without-libintl-prefix --with-system-zlib
https://www.webb-dev.co.uk/sports/gym-during-covid/
--enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
--enable-libstdcxx-filesystem-ts
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.