bug-cvs
[Top][All Lists]
Advanced

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

some more leaks & patches


From: Kenneth Lorber
Subject: some more leaks & patches
Date: Thu, 19 Jun 2003 13:29:40 -0400 (EDT)

A couple more.

Share and Enjoy,
keni


*** ChangeLog.x Thu Jun 19 13:15:16 2003
--- ChangeLog   Thu Jun 19 13:19:11 2003
***************
*** 1,3 ****
--- 1,9 ----
+ 2003-06-19  Kenneth Lorber  <address@hidden>
+       * annotate.c (rannotate_proc) Fix memory leak.
+       * buffer.c (buf_free) Fix memory leak.
+       * rcs.c (RCS_parsercsfile) Fix file left open.
+       * server.c (fd_buffer_shutdown) Fix memory leak.
+ 
  2003-06-12  Kenneth Lorber  <address@hidden>
        New feature: loginfo filters starting with a hyphen are called once
        with details on stdin.
diff -c src.orig/annotate.c src/annotate.c
*** src.orig/annotate.c Tue Jun 17 10:22:32 2003
--- src/annotate.c      Wed Jun 18 12:46:41 2003
***************
*** 222,227 ****
--- 222,228 ----
        {
            error (0, errno, "cannot chdir to %s", repository);
            free (repository);
+           free (where);
            return (1);
        }
        /* End section which is identical to patch_proc.  */
***************
*** 249,254 ****
--- 250,256 ----
                            argc - 1, argv + 1, local, which, 0, CVS_LOCK_READ,
                            where, 1, repository );
      if ( which & W_REPOS ) free ( repository );
+     if ( where ) free ( where );
      return err;
  }
  
diff -c src.orig/buffer.c src/buffer.c
*** src.orig/buffer.c   Tue Jun 17 10:22:32 2003
--- src/buffer.c        Wed Jun 18 12:52:03 2003
***************
*** 65,70 ****
--- 65,71 ----
        buf->last->next = free_buffer_data;
        free_buffer_data = buf->data;
      }
+     if (buf->closure) free (buf->closure);
      free (buf);
  }
  
diff -c src.orig/rcs.c src/rcs.c
*** src.orig/rcs.c      Tue Jun 17 10:22:32 2003
--- src/rcs.c   Thu Jun 19 09:34:42 2003
***************
*** 253,258 ****
--- 257,264 ----
      }
  
      rcs = RCS_parsercsfile_i (fp, rcsfile);
+ 
+     if(!rcs) fclose(fp);      /* FIXME: do we need to check fclose return? */
  
      return (rcs);
  }
diff -c src.orig/server.c src/server.c
*** src.orig/server.c   Tue Jun 17 10:22:32 2003
--- src/server.c        Thu Jun 19 09:17:01 2003
***************
*** 320,325 ****
--- 322,328 ----
       struct buffer *buf;
  {
      free (buf->closure);
+     buf->closure = 0;
      return 0;
  }
  




reply via email to

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