Small bug in juce_fileOpen (posix)


#1

Hi Jules,

valgrind pointed me to another use of already freed memory in juce_fileOpen ( juce_posix_SharedCode.h )

When the file is opened for writing, the buffer returned by

is realloc-ed during the call to juce_fileExists (fileName, false)

Hence in that case it is no more valid when open (fileNameUTF8, flags, 00644); is called


#2

same bug in juce_deleteFile


#3

Good old valgrind! That’s quite a subtle one, too - I’ll get it smartened up right away…