Ticket #1917: ngx_hash.c.patch

File ngx_hash.c.patch, 736 bytes (added by wp02855@…, 7 years ago)

patch file for bug reported in ticket 1917

  • ngx_hash.c

    old new  
    696696    ha->dns_wc_head_hash = ngx_pcalloc(ha->temp_pool,
    697697                                       sizeof(ngx_array_t) * ha->hsize);
    698698    if (ha->dns_wc_head_hash == NULL) {
     699        ngx_pfree(ha->keys_hash);   /* release previous memory allocation */
    699700        return NGX_ERROR;
    700701    }
    701702
    702703    ha->dns_wc_tail_hash = ngx_pcalloc(ha->temp_pool,
    703704                                       sizeof(ngx_array_t) * ha->hsize);
    704705    if (ha->dns_wc_tail_hash == NULL) {
     706        ngx_pfree(ha->dns_wc_tail_hash);    /* release tail_hash    */
     707        ngx_pfree(ha->keys_hash);           /* release keys_hash    */
    705708        return NGX_ERROR;
    706709    }
    707710