httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cliff Woolley" <JWOOL...@wlu.edu>
Subject [PATCH] buckets: fix a memory leak and a typo
Date Fri, 21 Jul 2000 21:22:34 GMT

Two minor changes to the buckets code.  The first change fixes a subtle
memory leak: one extra bucket was being created even though there was
nothing to put in it, and since it was never being linked into the
brigade, it would never be destroyed.  The second change just removes an
extra semicolon.

--Cliff


? Makefile.in
cvs server: Diffing .
Index: ap_buf.c
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/buckets/ap_buf.c,v
retrieving revision 1.15
diff -u -r1.15 ap_buf.c
--- ap_buf.c    2000/07/20 16:14:24     1.15
+++ ap_buf.c    2000/07/21 21:15:10
@@ -253,12 +253,12 @@
     }

     for (k = 0;;) {
-        r = ap_bucket_rwmem_create();
         x = va_arg(va, const char *);
         if (x == NULL)
             break;
         j = strlen(x);

+        r = ap_bucket_rwmem_create();
         rv = r->insert(r, x, j, &i);
         if (i != j) {
             /* Do we need better error reporting?  */
Index: ap_mmap_buf.c
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/buckets/ap_mmap_buf.c,v
retrieving revision 1.7
diff -u -r1.7 ap_mmap_buf.c
--- ap_mmap_buf.c       2000/07/20 16:14:24     1.7
+++ ap_mmap_buf.c       2000/07/21 21:15:10
@@ -77,7 +77,7 @@
     ap_bucket_mmap *b = (ap_bucket_mmap *)e->data;
     ap_mmap_t *mm = (ap_mmap_t *)buf;

-    b->alloc_addr = mm->mm;;
+    b->alloc_addr = mm->mm;
     b->len = nbytes;
     *w = nbytes;
     return APR_SUCCESS;

Mime
View raw message