Changeset eee1432 in mod_gnutls for src/gnutls_config.c


Ignore:
Timestamp:
Jun 15, 2016, 6:12:50 PM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, master, upstream
Children:
44e8944
Parents:
45b7b83
Message:

Bind temporary pool in mgs_load_files() to ptemp scope

Pool 'spool' is destroyed at the end of the function, so the temporary
scope is definitely appropriate. This ensures cleanup in case a bug
prevents explicit pool destruction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_config.c

    r45b7b83 reee1432  
    176176}
    177177
    178 int mgs_load_files(apr_pool_t * p, server_rec * s)
     178int mgs_load_files(apr_pool_t *pconf, apr_pool_t *ptemp, server_rec *s)
    179179{
    180180    apr_pool_t *spool;
     
    186186                                                 &gnutls_module);
    187187
    188     apr_pool_create(&spool, p);
    189 
    190     sc->cert_pgp = apr_pcalloc(p, sizeof(sc->cert_pgp[0]));
    191     sc->cert_crt_pgp = apr_pcalloc(p, sizeof(sc->cert_crt_pgp[0]));
     188    apr_pool_create(&spool, ptemp);
     189
     190    sc->cert_pgp = apr_pcalloc(pconf, sizeof(sc->cert_pgp[0]));
     191    sc->cert_crt_pgp = apr_pcalloc(pconf, sizeof(sc->cert_crt_pgp[0]));
    192192    sc->certs_x509_chain =
    193         apr_pcalloc(p, MAX_CHAIN_SIZE * sizeof(sc->certs_x509_chain[0]));
     193        apr_pcalloc(pconf, MAX_CHAIN_SIZE * sizeof(sc->certs_x509_chain[0]));
    194194    sc->certs_x509_crt_chain =
    195         apr_pcalloc(p, MAX_CHAIN_SIZE * sizeof(sc->certs_x509_crt_chain[0]));
     195        apr_pcalloc(pconf, MAX_CHAIN_SIZE * sizeof(sc->certs_x509_crt_chain[0]));
    196196
    197197    /* Cleanup function for the GnuTLS structures allocated below */
    198     apr_pool_cleanup_register(p, sc, mgs_pool_free_credentials,
     198    apr_pool_cleanup_register(pconf, sc, mgs_pool_free_credentials,
    199199                              apr_pool_cleanup_null);
    200200
Note: See TracChangeset for help on using the changeset viewer.