Changeset 1011 for trunk/dll/wrappers.c


Ignore:
Timestamp:
May 11, 2008, 5:00:39 AM (17 years ago)
Author:
Gregg Young
Message:

Fortify updates to get it working everywhere

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/wrappers.c

    r1009 r1011  
    332332# ifdef FORTIFY
    333333    Fortify_free(pv, pszSrcFile, uiLineNumber);
    334 # else 
     334# else
    335335    free(pv);
    336336# endif
     
    345345# ifdef FORTIFY
    346346  PVOID pv = Fortify_malloc(cBytes, pszSrcFile, uiLineNumber);
    347 # else 
     347# else
    348348  PVOID pv = malloc(cBytes);
    349349# endif
     
    359359PVOID xmallocz(size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber)
    360360{
    361   PVOID pv = malloc(cBytes);
    362 
    363   if (!pv)
    364     Runtime_Error(pszSrcFile, uiLineNumber, GetPString(IDS_OUTOFMEMORY));
    365   else
     361  PVOID pv = xmalloc(cBytes, pszSrcFile, uiLineNumber);
     362
     363  if (pv)
    366364    memset(pv, 0, cBytes);
    367365
     
    374372{
    375373  if (pvIn != NullStr) {
    376     PVOID pv = realloc(pvIn, cBytes);
     374# ifdef FORTIFY
     375  PVOID pv = Fortify_realloc(pvIn, cBytes, pszSrcFile, uiLineNumber);
     376# else
     377  PVOID pv = realloc(pvIn, cBytes);
     378# endif
    377379
    378380    if (!pv && cBytes)
     
    391393# ifdef FORTIFY
    392394  PSZ psz = Fortify_strdup(pszIn, pszSrcFile, uiLineNumber);
    393 # else 
     395# else
    394396  PSZ psz = strdup(pszIn);
    395397# endif
Note: See TracChangeset for help on using the changeset viewer.