httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1599531 - in /httpd/httpd/trunk: CHANGES include/ap_listen.h server/listen.c server/mpm/event/event.c server/mpm/prefork/prefork.c server/mpm/worker/worker.c server/mpm_unix.c
Date Mon, 06 Oct 2014 21:58:36 GMT
Sorry this won't work.

On Mon, Oct 6, 2014 at 9:52 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
> Oups, I forgot the cleanup :p
>
> On Mon, Oct 6, 2014 at 9:45 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
>> Index: server/mpm/prefork/prefork.c
>> ===================================================================
>> --- server/mpm/prefork/prefork.c    (revision 1629482)
>> +++ server/mpm/prefork/prefork.c    (working copy)
> [...]
>> @@ -1232,6 +1250,16 @@ static int prefork_run(apr_pool_t *_pconf, apr_poo
>>          return DONE;
>>      }
>>
>> +    if (!retained->bucket) {
>> +        retained->daemons_limit = ap_daemons_limit;
>> +        retained->bucket = ap_malloc(sizeof(int) * ap_daemons_limit);
>> +        if (!retained->bucket) {
>> +            ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf, APLOGNO()
>> +                         "could not allocate buckets");
>> +        }
>
> Here:
> +        apr_pool_cleanup_register(s->process->pool, retained->bucket,
> +                                  free_bucket, apr_pool_cleanup_null);

Here we have to use:
+        apr_pool_cleanup_register(s->process->pool, &retained->bucket,
+                                  free_bucket, apr_pool_cleanup_null);

>
>> +    }
>> +    memcpy(retained->bucket, bucket, sizeof(int) * ap_daemons_limit);
>> +
>>      /* advance to the next generation */
>>      /* XXX: we really need to make sure this new generation number isn't in
>>       * use by any of the children.
>> [END]
>
> With :
>
> static apr_status_t free_bucket(void *bucket)
> {
>     free(bucket);

And here:
    free(*(int **)bucket);

>     return APR_SUCCESS;
> }

Mime
View raw message