Changeset 1442 for trunk/dll


Ignore:
Timestamp:
Jul 14, 2009, 2:16:38 AM (16 years ago)
Author:
Gregg Young
Message:

Fixed 2 memory management problems; changes to get FORTIFY build to work again.

Location:
trunk/dll
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r1439 r1442  
    6868  12 Jul 09 GKY Add szFSType to FillInRecordFromFSA use to bypass EA scan and size formatting
    6969                for tree container
     70  13 Jul 09 GKY Fixed double free of memory buffer in UM_COLLECTFROMFILE
    7071
    7172***********************************************************************/
     
    870871        fclose(fp);
    871872      }
    872     }
    873     xfree(mp1, pszSrcFile, __LINE__);
     873      free(mp1);
     874    }
    874875#   ifdef FORTIFY
    875876    Fortify_LeaveScope();
     
    15801581      Fortify_BecomeOwner(mp1);
    15811582#     endif
    1582       if (!dcd)
    1583         Runtime_Error(pszSrcFile, __LINE__, NULL);
     1583      if (!dcd) {
     1584        Runtime_Error(pszSrcFile, __LINE__, NULL);
     1585        free(mp1);
     1586      }
    15841587      else {
    15851588        if (!PostMsg(dcd->hwndObject, UM_COLLECTFROMFILE, mp1, mp2)) {
    1586           Runtime_Error(pszSrcFile, __LINE__, PCSZ_POSTMSG);
    1587         }
    1588       }
    1589       free(mp1);
     1589          Runtime_Error(pszSrcFile, __LINE__, PCSZ_POSTMSG);
     1590          free(mp1);
     1591        }
     1592      }
    15901593#     ifdef FORTIFY
    15911594      DosSleep(1);                      // Let receiver take ownership
  • trunk/dll/excputil.c

    r1332 r1442  
    3030
    3131#include "excputil.h"
     32#include "fortify.h"
    3233
    3334static PSZ pszSrcFile = __FILE__;
  • trunk/dll/fortify.c

    r1438 r1442  
    15711571                }
    15721572
    1573                 sprintf(st_Buffer, "%02x%s", *ptr, ((column % 4) == 3) ? " " : NullStr);
     1573                sprintf(st_Buffer, "%02x%s", *ptr, ((column % 4) == 3) ? " " : "");
    15741574                st_Output(st_Buffer);
    15751575
  • trunk/dll/mainwnd.c

    r1439 r1442  
    9191  12 Jul 09 GKY Removed duplicate UM_SETUP2 message from RestoreDirCnrState caused dbl dir
    9292                listings in tree
     93  13 Jul 09 GKY Fixed under allocation of memory in the paint code for the drivebar bitmap buttons
    9394
    9495***********************************************************************/
     
    19291930        hbm = GpiLoadBitmap(hps, 0, iconid, 0, 0);
    19301931        if (hbm) {
    1931           pbmpData = xmallocz(sizeof(PBITMAPINFOHEADER), pszSrcFile, __LINE__);
     1932          pbmpData = xmallocz(sizeof(PBITMAPINFOHEADER) * 3, pszSrcFile, __LINE__);
    19321933          if (pbmpData) {
    19331934            GpiQueryBitmapParameters(hbm, pbmpData);
     
    19361937            aptl[3].x = pbmpData->cx;
    19371938            aptl[3].y = pbmpData->cy;
     1939            GpiWCBitBlt(hps, hbm, 4L, aptl, ROP_SRCCOPY, BBO_PAL_COLORS);
    19381940            free(pbmpData);
    19391941          }
    1940           GpiWCBitBlt(hps, hbm, 4L, aptl, ROP_SRCCOPY, BBO_PAL_COLORS);
    19411942        }
    19421943        memset(&fat, 0, sizeof(fat));
Note: See TracChangeset for help on using the changeset viewer.