From 98b585ee26f14ea0927386f26200a2e641272bb9 Mon Sep 17 00:00:00 2001 From: jonas Date: Tue, 19 Feb 2019 02:21:04 +0100 Subject: Further memory leak fixes --- main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 0f99ad3..f0803ca 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) if(bitmap.error) { - printf("Error reading file"); + printf("Error reading file\n"); return 1; } @@ -131,10 +131,20 @@ int main(int argc, char *argv[]) //Cleanup - for(int i = 0; i < size_y; i++) + for(int i = 0; i < size_x; i++) free (ascii_buff[i]); free(ascii_buff); + for(int i = 0; i < bitmap.x; i++) + { + free(bitmap.R[i]); + free(bitmap.G[i]); + free(bitmap.B[i]); + } + free(bitmap.R); + free(bitmap.G); + free(bitmap.B); + fclose(out); return 0; -- cgit v1.2.3