httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@hyperreal.org
Subject cvs commit: apache-apr/apr/test testfile.c
Date Fri, 09 Apr 1999 15:05:17 GMT
rbb         99/04/09 08:05:17

  Modified:    apr/file_io/unix open.c
               apr/test testfile.c
  Log:
  I got rid of the memory leak related to opening and closing files.
  
  Revision  Changes    Path
  1.11      +5 -0      apache-apr/apr/file_io/unix/open.c
  
  Index: open.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/file_io/unix/open.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- open.c	1999/04/08 17:09:30	1.10
  +++ open.c	1999/04/09 15:05:15	1.11
  @@ -91,6 +91,7 @@
       }
       if ((flag & APR_EXCL) && !(flag & APR_CREATE)) {
           errno = EACCES;
  +        free(dafile->fname);
   	free(dafile);
           return NULL;
       }   
  @@ -112,6 +113,7 @@
       
       if (dafile->filedes < 0) {
           dafile->filedes = -1;
  +        free(dafile->fname);
           free(dafile);
           return NULL;
       }
  @@ -121,6 +123,7 @@
       }
       else {
           errno = ENOSTAT;
  +        free(dafile->fname);
   	free(dafile);
           return NULL;
       }
  @@ -130,6 +133,8 @@
   {
       if (close(file->filedes) == 0) {
           file->filedes = -1;
  +        free(file->fname);
  +        free(file);
           return APR_SUCCESS;
       }
       else {
  
  
  
  1.8       +1 -1      apache-apr/apr/test/testfile.c
  
  Index: testfile.c
  ===================================================================
  RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- testfile.c	1999/04/09 14:36:59	1.7
  +++ testfile.c	1999/04/09 15:05:16	1.8
  @@ -152,7 +152,7 @@
       }
       
       fprintf(stdout, "\tDeleting file.......");
  -    status = apr_remove_file(thefile->fname);
  +    status = apr_remove_file(filename);
       if (status == APR_FAILURE) {
           fprintf(stderr, "Couldn't delete the file\n");
           exit(-1); 
  
  
  

Mime
View raw message