I just noticed a possible memory leak:
|
static int |
|
region_create_rectangles (lua_State *L) { |
|
size_t max_entries = lua_objlen (L, 1); |
|
cairo_rectangle_int_t *rects = calloc(max_entries, sizeof(*rects)); |
|
size_t i = 0; |
|
|
|
/* Now iterate over the table */ |
|
lua_pushnil(L); |
|
while (lua_next(L, 1) != 0) { |
|
if (i >= max_entries) |
|
return luaL_error(L, "Cairo.region_create_rectangles(): Internal error, table larger than table?!"); |
The
calloc result is leaked if an error happens (either via
luaL_error or via
lua_next doing a longjmp).
I just noticed a possible memory leak:
oocairo/obj_region.c
Lines 40 to 50 in 2aba6f9
The
callocresult is leaked if an error happens (either vialuaL_erroror vialua_nextdoing a longjmp).