[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978
From: |
tromey at sourceware dot org |
Subject: |
[Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978 |
Date: |
Fri, 30 Apr 2021 15:05:32 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=27797
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I didn't see this patch on the mailing list, so I didn't reply there.
I think what realloc does when passed a 0 size is implementation-defined.
It may call free, but it may not. So, I think some other change is
needed, because with the current code you either get a double free
or a memory leak, depending on the underlying malloc implementation.
One simple thing to do would be like "if (size == 0) size = 1"
to avoid the problem entirely.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/27797] New: [size] attempting double-free on bfd/mach-o.c:5978, dkcjd2000 at gmail dot com, 2021/04/29
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, dkcjd2000 at gmail dot com, 2021/04/29
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, dkcjd2000 at gmail dot com, 2021/04/29
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, nickc at redhat dot com, 2021/04/30
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, cvs-commit at gcc dot gnu.org, 2021/04/30
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, nickc at redhat dot com, 2021/04/30
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978,
tromey at sourceware dot org <=
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, nickc at redhat dot com, 2021/04/30
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, mark at klomp dot org, 2021/04/30
- [Bug binutils/27797] [size] attempting double-free on bfd/mach-o.c:5978, tromey at sourceware dot org, 2021/04/30