gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 15601a7: Library (arithmetic): no extra freein


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 15601a7: Library (arithmetic): no extra freeing in sigclip and quantile
Date: Tue, 24 Nov 2020 09:19:31 -0500 (EST)

branch: master
commit 15601a7876a772af293dcf781b21dc305106827b
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Library (arithmetic): no extra freeing in sigclip and quantile
    
    Until now, when the Arithemtic program was run with the sigclip-* or
    quantile operators it would crash on some systems with a double free
    error. The reason was a recently added 'free(pixs)' command that was added
    after these parameters because I mistakenly thought that we are not freeing
    them. However, the allocated pointers were set inside the 'cont' array and
    freed within that.
    
    With this commit, the extra 'free(pixs)' command has been removed and a
    comment has been added to remind future readers of the code about the
    possible confusion.
    
    This issue was reported by Alberto Madrigal.
---
 THANKS                       | 1 +
 doc/announce-acknowledge.txt | 1 +
 lib/arithmetic.c             | 6 ++----
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/THANKS b/THANKS
index d4eec25..c1c0e9f 100644
--- a/THANKS
+++ b/THANKS
@@ -59,6 +59,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     Floriane Leclercq                    floriane.leclercq@univ-lyon1.fr
     Alan Lefor                           alefor@astr.tohoku.ac.jp
     Sebastián Luna Valero                sluna@iaa.es
+    Alberto Madrigal                     brt.madrigal@gmail.com
     Guillaume Mahler                     guillaume.mahler@univ-lyon1.fr
     Raphael Morales                      rmorales@iaa.es
     Juan Molina Tobar                    juan.a.molina.t@gmail.com
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 6418f06..52fac35 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -4,6 +4,7 @@ Martin Kuemmel
 Sebastian Luna Valero
 Samane Raji
 Francois Ochsenbein
+Alberto Madrigal
 Carlos Morales Socorro
 Joanna Sakowska
 Zahra Sharbaf
diff --git a/lib/arithmetic.c b/lib/arithmetic.c
index 852a6e1..6d0f5a2 100644
--- a/lib/arithmetic.c
+++ b/lib/arithmetic.c
@@ -1138,8 +1138,7 @@ struct multioperandparams
           o[j]=b;                                                       \
       }                                                                 \
                                                                         \
-    /* Clean up. */                                                     \
-    free(pixs);                                                         \
+    /* Clean up (note that 'pixs' is inside of 'cont'). */              \
     gal_data_free(cont);                                                \
   }
 
@@ -1195,8 +1194,7 @@ struct multioperandparams
           o[j]=b;                                                       \
       }                                                                 \
                                                                         \
-    /* Clean up. */                                                     \
-    free(pixs);                                                         \
+    /* Clean up (note that 'pixs' is inside of 'cont'). */              \
     gal_data_free(cont);                                                \
   }
 



reply via email to

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