git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93038
13f79535-47bb-0310-9956-
ffa450edef68
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));