This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53330] new() operator can return NULL on a zero-length allocation


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53330

--- Comment #1 from Adam Borowski <kilobyte at angband dot pl> 2012-05-12 11:01:23 UTC ---
Correction: after testing with valgrind, the return value is indeed
uninitialized; the pointer in contructor-but-no-fields case happens to be
non-zero but is junk and will cause a crash when you try to free it.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]