OOPS! It should have allocated 1024 bytes to begin with, I will have to fix that.
As for iconv() not requiring malloc()ed buffers, I don't remember exactly why I did everything the way I did, but I do know that iconv() has a bastard of a memory leak, and I spent some quality time figuring out how to write my code around it to minimize that leak to avoid program crashes. So I will not likely change coding of iconv() unless it is to fix something that is actually broken.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This likely may destroy the heap:
ddru_ntfsbitmap.c(314) allocates 512 bytes:
ddru_ntfscommon.c(55) fills 1024 bytes:
I would suggest to use fixed size arrays and sizeof() here as iconv() does not require malloc()ed buffers.
OOPS! It should have allocated 1024 bytes to begin with, I will have to fix that.
As for iconv() not requiring malloc()ed buffers, I don't remember exactly why I did everything the way I did, but I do know that iconv() has a bastard of a memory leak, and I spent some quality time figuring out how to write my code around it to minimize that leak to avoid program crashes. So I will not likely change coding of iconv() unless it is to fix something that is actually broken.