diff options
-rw-r--r-- | src/ft_exit.c | 7 | ||||
-rw-r--r-- | src/ft_save_to_bmp.c | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index e2a8676..4c89bc6 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -44,6 +44,11 @@ static void i++; } ft_memdel((void*)&clist->sprites); + if (!clist->wlist.inited) + { + ft_memdel((void*)&clist->wlist.winptr); + ft_memdel((void*)&clist->wlist.wlx); + } ft_memdel((void*)&clist); } @@ -77,8 +82,6 @@ static void while (++i < 2) ft_memdel((void*)&clist->weaps[i]); ft_memdel((void*)&clist->weaps); - if (!clist->wlist.inited) - ft_memdel((void*)&clist->wlist.winptr); } static void diff --git a/src/ft_save_to_bmp.c b/src/ft_save_to_bmp.c index 1737226..24d28d8 100644 --- a/src/ft_save_to_bmp.c +++ b/src/ft_save_to_bmp.c @@ -53,8 +53,8 @@ static uint8_t uint32_t i; (void)img; - if (!(bmp = (uint8_t*)malloc((3 * cl->wlist.x_size - * cl->wlist.y_size) * sizeof(uint8_t)))) + if (!(bmp = (uint8_t*)ft_calloc(3 * cl->wlist.x_size + * cl->wlist.y_size, sizeof(uint8_t)))) return (NULL); y = cl->wlist.y_size; i = 0; |