Skip to content

Commit 662659f

Browse files
committed
Fix memory leak in get_bounds() function in render.c
1 parent f88b2ee commit 662659f

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)