Ticket #108: double-frees.patch

File double-frees.patch, 889 bytes (added by Richard Boulton, 18 years ago)

Patch to avoid double frees if transactions fail

  • backends/flint/flint_table.cc

     
    15231523
    15241524    for (int j = level; j >= 0; j--) {
    15251525        delete [] C[j].p;
     1526        C[j].p = 0;
    15261527    }
    15271528    delete [] split_p;
     1529    split_p = 0;
    15281530
    15291531    delete [] kt.get_address();
     1532    kt = 0;
    15301533    delete [] buffer;
     1534    buffer = 0;
    15311535}
    15321536
    15331537void
  • backends/quartz/btree.cc

     
    15551555
    15561556    for (int j = level; j >= 0; j--) {
    15571557        delete [] C[j].p;
     1558        C[j].p = 0;
    15581559    }
    15591560    delete [] split_p;
     1561    split_p = 0;
    15601562
    15611563    delete [] kt.get_address();
     1564    kt = 0;
    15621565    delete [] buffer;
     1566    buffer = 0;
    15631567}
    15641568
    15651569void