Ignore:
Timestamp:
2008-04-27T20:15:53+12:00 (16 years ago)
Author:
davidb
Message:

Even though db2txt is written in C++, GDBM is written in C and therefore memory allocated by GDBM to keys should be release using C's free() rather than C++'s delete mechanism. Also spotted a memory leak (missing free) which has also be added, and tested with CCMalloc to make sure everything is working as it should be.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/db2txt/db2txt.cpp

    r9596 r15218  
    9191      cout << value.dptr[i];
    9292    cout << "\n----------------------------------------------------------------------\n";
     93    free(value.dptr);
     94
     95    free(key.dptr);
    9396    key = gdbm_nextkey (dbf, key);
    94     delete value.dptr;
    9597  }
    9698 
Note: See TracChangeset for help on using the changeset viewer.