Skip to content

Commit 4b983a0

Browse files
authored
Merge pull request #15 from saxbophone/render-get-bounds-memory-leak
Fix memory leak in get_bounds() function in render.c
2 parents f88b2ee + 662659f commit 4b983a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

saxbospiral/render.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ render_spiral(spiral_t spiral) {
7777
.x = bounds.items[1].x + normalisation_vector.x,
7878
.y = bounds.items[1].y + normalisation_vector.y,
7979
};
80+
// free memory allocated for bounds.items, as we no longer need it
81+
free(bounds.items);
8082
// initialise output bitmap - image dimensions are twice the size + 1
8183
bitmap_t output = {
8284
.width = ((bottom_right.x + 1) * 2) + 1,

0 commit comments

Comments
 (0)