httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject palloc() bug patch
Date Sat, 14 Dec 1996 16:50:44 GMT
Index: alloc.c
===================================================================
RCS file: /export/home/cvs/apache/src/alloc.c,v
retrieving revision 1.19
diff -c -r1.19 alloc.c
*** alloc.c     1996/12/01 20:28:10     1.19
--- alloc.c     1996/12/14 17:53:41
***************
*** 100,106 ****



! /* Get a completely new block from the system pool */

  union block_hdr *malloc_block (int size)
  {
--- 100,107 ----



! /* Get a completely new block from the system pool. Note that we rely on
! malloc() to provide aligned memory. */

  union block_hdr *malloc_block (int size)
  {
***************
*** 338,344 ****

    int nclicks = 1 + ((reqsize - 1) / CLICK_SZ);
    int size = nclicks * CLICK_SZ;
!
    /* First, see if we have space in the block most recently
     * allocated to this pool
     */
--- 339,345 ----

    int nclicks = 1 + ((reqsize - 1) / CLICK_SZ);
    int size = nclicks * CLICK_SZ;
!
    /* First, see if we have space in the block most recently
     * allocated to this pool
     */
***************
*** 347,353 ****
    char *first_avail = blok->h.first_avail;
    char *new_first_avail;

!   if (size <= 0) size = 1;
    new_first_avail = first_avail + size;

    if (new_first_avail <= blok->h.endp) {
--- 348,356 ----
    char *first_avail = blok->h.first_avail;
    char *new_first_avail;

!   if(reqsize <= 0)
!       return NULL;
!
    new_first_avail = first_avail + size;

    if (new_first_avail <= blok->h.endp) {

-- 
Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author

Mime
View raw message