httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lai Yiu Fai <>
Subject uninitialized shared memory in mod_auth_digest.c
Date Tue, 04 Jul 2006 02:31:35 GMT
I am writing a module which implements a shared memory cache and read the
code of mod_auth_digest.c for reference.  Take a code snippet of initializing
the shared memory.

    sts = apr_shm_create(&client_shm, shmem_size, tmpnam(NULL), ctx);
    if (sts != APR_SUCCESS) {
        log_error_and_cleanup("failed to create shared memory segments", sts, s);

    client_list = apr_rmm_malloc(client_rmm, sizeof(*client_list) +
    if (!client_list) {
        log_error_and_cleanup("failed to allocate shared memory", -1, s);

The variable client_rmm is ever initialized up to calling apr_rmm_malloc() but
it seems running fine.  I suppose there is a missing of apr_rmm_init() before
to make shared memory block relocatable, and then follow by apr_rmm_addr_get()
to map the relocatable memory block.  Is it the dirty shortcut that skipped
these calls?


View raw message