httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Sat, 26 Jan 2002 23:05:11 GMT
trawick     02/01/26 15:05:11

  Modified:    server   core.c
  Log:
  avoid a palloc of zero bytes so memory debuggers don't barf
  
  Revision  Changes    Path
  1.136     +9 -0      httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.135
  retrieving revision 1.136
  diff -u -r1.135 -r1.136
  --- core.c	25 Jan 2002 01:11:47 -0000	1.135
  +++ core.c	26 Jan 2002 23:05:10 -0000	1.136
  @@ -483,6 +483,15 @@
       nelts = sec_dir->nelts;
       elts = (ap_conf_vector_t **)sec_dir->elts;
   
  +    if (!nelts) {
  +        /* simple case of already being sorted... */
  +        /* We're not checking this condition to be fast... we're checking
  +         * it to avoid trying to palloc zero bytes, which can trigger some
  +         * memory debuggers to barf
  +         */
  +        return;
  +    }
  +    
       /* we have to allocate tmp space to do a stable sort */
       apr_pool_create(&tmp, p);
       sortbin = apr_palloc(tmp, sec_dir->nelts * sizeof(*sortbin));
  
  
  

Mime
View raw message