From b59383d971fac7105c91597d7897ef65c81ec42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Mon, 10 Sep 2012 21:59:29 +0200 Subject: [PATCH] Explicitly deallocate storage before exit. --- ChangeLog | 3 +++ examples/eratosthenes.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2c1fde94..fe61ad96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2012-09-10 Niels Möller <nisse@lysator.liu.se> + * examples/eratosthenes.c (main): Explicitly deallocate storage + before exit. + * examples/io.c (read_file): Explicitly treat an empty file as an error. Rearrange loop, check for short fread return value. diff --git a/examples/eratosthenes.c b/examples/eratosthenes.c index 2b9d04fd..966506aa 100644 --- a/examples/eratosthenes.c +++ b/examples/eratosthenes.c @@ -399,5 +399,9 @@ main (int argc, char **argv) printf("%lu\n", n); } } + + free(sieve); + free(block); + return EXIT_SUCCESS; } -- GitLab