-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I just noticed a possible memory leak:
Lines 40 to 50 in 2aba6f9
| 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).Metadata
Metadata
Assignees
Labels
No labels