gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master e1d355a 4/5: One-line non-critical fixes


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master e1d355a 4/5: One-line non-critical fixes
Date: Sat, 2 Dec 2017 22:07:25 -0500 (EST)

branch: master
commit e1d355a97420f1ec914c5be334e8f7e0b991f3f6
Author: Vladimir Markelov <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    One-line non-critical fixes
    
    1. bin/fits/ui.c
    
       The same option is checked in `if' condition twice. As far as I
       understand it is just a duplicate that can be removed - I did not find
       another option that probably was missed
    
    2. bin/buildprog/buildprog.c
    
       A memory leak - in a branch some memory is allocated by asprintf but
       never freed before returning.
---
 bin/buildprog/buildprog.c | 1 +
 bin/fits/ui.c             | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c
index aff4585..d2f9ea2 100644
--- a/bin/buildprog/buildprog.c
+++ b/bin/buildprog/buildprog.c
@@ -161,5 +161,6 @@ buildprog(struct buildprogparams *p)
   free(command);
   if(warning) free(warning);
   if(optimize) free(optimize);
+  if(!p->la && fullla) free(fullla);
   return retval;
 }
diff --git a/bin/fits/ui.c b/bin/fits/ui.c
index 880ea35..6713c10 100644
--- a/bin/fits/ui.c
+++ b/bin/fits/ui.c
@@ -224,7 +224,7 @@ ui_read_check_only_options(struct fitsparams *p)
   /* If any of the keyword manipulation options are requested, then set the
      mode flag to keyword-mode. */
   if( p->date || p->comment || p->history || p->asis || p->delete
-      || p->rename || p->rename || p->update || p->write || p->printallkeys )
+      || p->rename || p->update || p->write || p->printallkeys )
     {
       /* Set the mode. */
       p->mode=FITS_MODE_KEY;



reply via email to

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