httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: memory leak
Date Wed, 07 Feb 2001 15:05:45 GMT


Bill,

Does this patch solve the memory leak you were seeing?

Index: apr_buckets_file.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_file.c,v
retrieving revision 1.26
diff -u -d -b -w -u -r1.26 apr_buckets_file.c
--- apr_buckets_file.c  2001/02/02 21:02:19     1.26
+++ apr_buckets_file.c  2001/02/07 14:48:38
@@ -117,6 +117,7 @@
     }
     if (mm) {
         apr_bucket_make_mmap(e, mm, 0, e->length); /*XXX: check for failure? */
+        file_destroy(s);
         return apr_bucket_read(e, str, len, block);
     }
     else {
@@ -152,6 +153,7 @@
          * even if we read nothing because we hit EOF.
          */
         apr_bucket_make_heap(e, buf, *len, 0, NULL); /*XXX: check for failure? */
+        file_destroy(s);

         /* If we have more to read from the file, then create another bucket */
         if (length > 0) {


It turns out that in all of our other bucket code, we do stuff like this,
so that we are sure to free the entire bucket.  I didn't add this to the
bucket code when I made it use the shared bucket type.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------



Mime
View raw message