coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build: allow build to complete with -fsanitize=address


From: Pádraig Brady
Subject: [PATCH] build: allow build to complete with -fsanitize=address
Date: Thu, 25 Jun 2015 02:48:25 +0100

* src/make-prime-list.c (main): When building with
the above option, avoid this build stopping error:
"LeakSanitizer: detected memory leaks"
---
 src/make-prime-list.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/make-prime-list.c b/src/make-prime-list.c
index b31e1ed..0d5b614 100644
--- a/src/make-prime-list.c
+++ b/src/make-prime-list.c
@@ -217,6 +217,9 @@ main (int argc, char **argv)
 
   output_primes (prime_list, nprimes);
 
+  free (sieve);
+  free (prime_list);
+
   if (ferror (stdout) + fclose (stdout))
     {
       fprintf (stderr, "write error: %s\n", strerror (errno));
-- 
2.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]