[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Memory leak in liolib.c read_file()?
- From: "Mauro Vezzosi"<mvezzosi@...>
- Date: Thu, 26 Oct 2000 09:19:51 +0200
Hi
In liolib.c the function read_file() allocates memory using realloc()
and if there isn't enough memory it calls lua_error().
Isn't be better to free the previously allocated buffer before calls
lua_error()? (realloc() doesn't free the buffer if it can't allocate
new memory, or not?)
Sorry if I am wrong.
Out of curiosity: why read_file() calls realloc() and read_chars
()/openwithcontrol() calls malloc() instead of the luaM_ versions? To
supply a specific error message?
Bye
Mauro