bug-cvs
[Top][All Lists]
Advanced

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

one more leak & patch


From: Kenneth Lorber
Subject: one more leak & patch
Date: Wed, 18 Jun 2003 12:32:07 -0400 (EDT)

One more.  This one has multiple bands and might better be implemented with
a variable for the return value and a "goto cleanup" type construct, but I
didn't want to do that much damage.

Share and Enjoy,
keni

*** ChangeLog.old       Wed Jun 18 12:21:23 2003
--- ChangeLog   Wed Jun 18 08:00:11 2003
***************
*** 1,4 ****
--- 1,7 ----
  2003-06-18  Kenneth Lorber  <address@hidden>
+       * tag.c: leak: tag_fileproc() doesn't free nversion (multiple places)
+ 
+ 2003-06-18  Kenneth Lorber  <address@hidden>
        * add.c: add() xmalloc's strlen of wrong variable
        * checkout.c: leak: safe_location() reuses where_location without free
        * log.c: leak: rlog_proc() exits without free of where
Index: tag.c
===================================================================
RCS file: /cvsroot/ccvs/src/tag.c,v
retrieving revision 1.103
diff -c -r1.103 tag.c
*** tag.c       11 Jun 2003 18:24:57 -0000      1.103
--- tag.c       18 Jun 2003 12:00:30 -0000
***************
*** 937,942 ****
--- 937,943 ----
        if (version == NULL || vers->srcfile == NULL)
        {
            freevers_ts (&vers);
+           if (nversion) free (nversion);
            return (0);
        }
        free (version);
***************
*** 952,957 ****
--- 953,959 ----
                        symtag, vers->srcfile->path,
                        isbranch ? "" : " due to `-B' option");
            freevers_ts (&vers);
+           if (nversion) free (nversion);
            return (1);
        }
  
***************
*** 962,967 ****
--- 964,970 ----
                       "failed to remove tag %s from %s", symtag,
                       vers->srcfile->path);
            freevers_ts (&vers);
+           if (nversion) free (nversion);
            return (1);
        }
        RCS_rewrite (vers->srcfile, NULL, NULL);
***************
*** 975,980 ****
--- 978,984 ----
        }
  
        freevers_ts (&vers);
+       if (nversion) free (nversion);
        return (0);
      }
  
***************
*** 993,998 ****
--- 997,1003 ----
      if (version == NULL)
      {
        freevers_ts (&vers);
+       if (nversion) free (nversion);
        return (0);
      }
      else if (strcmp (version, "0") == 0)
***************
*** 1000,1005 ****
--- 1005,1011 ----
        if (!quiet)
            error (0, 0, "couldn't tag added but un-commited file `%s'", 
finfo->file);
        freevers_ts (&vers);
+       if (nversion) free (nversion);
        return (0);
      }
      else if (version[0] == '-')
***************
*** 1007,1012 ****
--- 1013,1019 ----
        if (!quiet)
            error (0, 0, "skipping removed but un-commited file `%s'", 
finfo->file);
        freevers_ts (&vers);
+       if (nversion) free (nversion);
        return (0);
      }
      else if (vers->srcfile == NULL)
***************
*** 1014,1019 ****
--- 1021,1027 ----
        if (!quiet)
            error (0, 0, "cannot find revision control file for `%s'", 
finfo->file);
        freevers_ts (&vers);
+       if (nversion) free (nversion);
        return (0);
      }
  
***************
*** 1042,1047 ****
--- 1050,1056 ----
            if (branch_mode)
                free (rev);
            freevers_ts (&vers);
+           if (nversion) free (nversion);
            return (0);
        }
  
***************
*** 1065,1070 ****
--- 1074,1080 ----
            if (branch_mode)
                free (rev);
            freevers_ts (&vers);
+           if (nversion) free (nversion);
            return (0);
        }
        else    /* force_tag_move == 1 and... */
***************
*** 1079,1084 ****
--- 1089,1095 ----
            free (oversion);
            if (branch_mode) free(rev);
            freevers_ts (&vers);
+           if (nversion) free (nversion);
            return (0);
        }
        free (oversion);
***************
*** 1092,1097 ****
--- 1103,1109 ----
        if (branch_mode)
            free (rev);
        freevers_ts (&vers);
+       if (nversion) free (nversion);
        return (1);
      }
      if (branch_mode)




reply via email to

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