[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How far should one go preventing potential memory leaks?
- From: Thomas Jericke <tjericke@...>
- Date: Tue, 10 May 2016 09:13:31 +0200
On 05/10/2016 09:10 AM, Thomas Jericke wrote:
On 05/10/2016 08:41 AM, Marc Balmer wrote:
This prevents a memory leak if lua_pushstring() raises an error, but
I will end
up with a number of rather small allocations that are only used for a
period of time.
If they buffers are really that small, I would just use the stack.
snprintf(s, sizeof(s), "bumblebee");
PS. I swear I typed this before I saw Sean's answer :-/