-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The comments inside helloworld.c shows there is an obviously memory leak.
/*
* Allocates a new interpreter, and pushes a value into the global table.
*
* Returns a pointer to the iterator. Since no deallocation function has
* been implemented, this will obviously leak memory.
*/
however, I'm not sure on this, since the allocator used below can free memory
blocks. Would you please clarify on this?
static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
(void)ud;
(void)osize;
if (nsize == 0) {
free(ptr);
return NULL;
}
else
return realloc(ptr, nsize);
}
Original issue reported on code.google.com by xu4wang@gmail.com on 18 Aug 2012 at 2:45