Ignore:
Timestamp:
08/13/14 18:04:16 (5 years ago)
Author:
jls17
Message:
  • fixed an issue with the GetExecutableDirectory? function (using the buffer-pointer after the realloc call isn't valid; we need to use the pointer returned by realloc)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/work_311/FileSystemUtil.cpp

    r485 r597  
    259259#if WIN32 
    260260        DWORD size = 1024; 
    261         LPTSTR buffer = (LPTSTR)malloc(size * sizeof(TCHAR)); 
     261        LPTSTR buffer = NULL; 
    262262ged_start: 
    263         if (realloc(buffer, size) == NULL) 
     263        buffer = (LPTSTR)realloc(buffer, size); 
     264        if (buffer == NULL) 
    264265        { 
    265266                cerr << "GetExecutableDirectory: Failed to realloc memory buffer to " << size << "!" << endl; 
     267                return ""; 
    266268        } 
    267269         
Note: See TracChangeset for help on using the changeset viewer.