Changeset 15218

Show
Ignore:
Timestamp:
27.04.2008 20:15:53 (12 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.

Files:
1 modified

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