Changeset 1039


Ignore:
Timestamp:
Jul 6, 2008, 12:16:21 AM (17 years ago)
Author:
Gregg Young
Message:

Removed unnecessary xfrees and included fortify.h where needed; moved several misplaced (x)frees;

Location:
trunk
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1038 r1039  
    14421442        if (!dcd->info->extract) {
    14431443          Runtime_Error(pszSrcFile, __LINE__, "no extract");
    1444           xfree(s, pszSrcFile, __LINE__);
     1444          free(s);
    14451445          return 0;
    14461446        }
     
    14721472        }
    14731473        // printf("%s %d UM_ENTER %s %s\n",__FILE__, __LINE__,filename, s); fflush(stdout);     // 10 Mar 07 SHL hang
    1474         xfree(s, pszSrcFile, __LINE__);
     1474        free(s);
    14751475        if (IsFile(filename) == 1) {
    14761476#if 1 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing
     
    17501750                  strcat(p, temp);
    17511751                  li->list[x] = p;
    1752                   xfree(temp, pszSrcFile, __LINE__);
     1752                  free(temp);
    17531753                }
    17541754              }
     
    19971997      FreeList(dcd->lastselection);
    19981998      WinSendMsg(dcd->hwndCnr, UM_CLOSE, MPVOID, MPVOID);
    1999       xfree(dcd, pszSrcFile, __LINE__);
     1999      free(dcd);
    20002000# ifdef FORTIFY
    20012001  Fortify_LeaveScope();
     
    25512551        hwnd = StartMLEEditor(dcd->hwndParent,
    25522552                              (INT)mp1, (CHAR *)mp2, dcd->hwndFrame);
    2553       xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     2553      free((CHAR *)mp2);
    25542554      return MRFROMLONG(hwnd);
    25552555    }
     
    29202920                BldFullPathName(s, dcd->workdir, li->list[x]);
    29212921                if (IsFile(s) != 1) {
    2922                   xfree(li->list[x], pszSrcFile, __LINE__);
     2922                  free(li->list[x]);
    29232923                  li->list[x] = NULL;
    29242924                  for (y = x; li->list[y]; y++)
     
    29322932                  p = xstrdup(s, pszSrcFile, __LINE__);
    29332933                  if (p) {
    2934                     xfree(li->list[x], pszSrcFile, __LINE__);
     2934                    free(li->list[x]);
    29352935                    li->list[x] = p;
    29362936                  }
     
    29802980            }
    29812981            else
    2982               xfree(li, pszSrcFile, __LINE__);
     2982              free(li);
    29832983# ifdef FORTIFY
    29842984  Fortify_LeaveScope();
     
    32443244              if (!PostMsg(dcd->hwndObject, UM_ENTER, MPFROMP(s), MPVOID)) {
    32453245                Runtime_Error(pszSrcFile, __LINE__, "post");
    3246                 xfree(s, pszSrcFile, __LINE__);
     3246                free(s);
    32473247              }
    32483248            }
     
    35403540                     IDS_WINCREATEWINDOW);
    35413541          PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    3542           xfree(dcd, pszSrcFile, __LINE__);
     3542          free(dcd);
    35433543# ifdef FORTIFY
    35443544  Fortify_LeaveScope();
  • trunk/dll/assoc.c

    r1029 r1039  
    3737#include "strutil.h"                    // GetPString
    3838#include "fm3dll.h"
     39#include "fortify.h"
    3940
    4041#pragma data_seg(DATA1)
     
    122123    xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    123124    xfree(info->sig, pszSrcFile, __LINE__);
    124     xfree(info, pszSrcFile, __LINE__);
     125    free(info);
    125126    info = next;
    126127  }
     
    185186          xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    186187          xfree(info->mask, pszSrcFile, __LINE__);
    187           xfree(info, pszSrcFile, __LINE__);
     188          free(info);
    188189          break;
    189190        }
     
    234235                        MPFROMSHORT(x), MPFROMSHORT(TRUE));
    235236    }
    236     xfree(pszDisplayStr, pszSrcFile, __LINE__);
     237    free(pszDisplayStr);
    237238  }
    238239}
     
    316317          xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    317318          xfree(info->mask, pszSrcFile, __LINE__);
    318           xfree(info, pszSrcFile, __LINE__);
     319          free(info);
    319320        }
    320321        else {
     
    363364        xfree(info->mask, pszSrcFile, __LINE__);
    364365        xfree(info->sig, pszSrcFile, __LINE__);
    365         xfree(info, pszSrcFile, __LINE__);
     366        free(info);
    366367        return TRUE;
    367368      }
     
    696697        pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    697698        if (!pszWorkBuf) {
    698           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     699          free(temp.pszCmdLine);
    699700          break; //already complained
    700701        }
     
    705706          memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);
    706707        }
    707         xfree(pszWorkBuf, pszSrcFile, __LINE__);
     708        free(pszWorkBuf);
    708709        WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig);
    709710        rstrip(temp.sig);
     
    732733        if (fCancelAction){
    733734          fCancelAction = FALSE;
    734           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     735          free(temp.pszCmdLine);
    735736          break;
    736737        }
     
    743744          save_associations();
    744745        }
    745         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     746        free(temp.pszCmdLine);
    746747      }
    747748      WinDismissDlg(hwnd, 1);
     
    771772        pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    772773        if (!pszWorkBuf) {
    773           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     774          free(temp.pszCmdLine);
    774775          break; //already complained
    775776        }
     
    780781          memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);
    781782        }
    782         xfree(pszWorkBuf, pszSrcFile, __LINE__);
     783        free(pszWorkBuf);
    783784        WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig);
    784785        rstrip(temp.sig);
     
    807808        if (fCancelAction){
    808809          fCancelAction = FALSE;
    809           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     810          free(temp.pszCmdLine);
    810811          break;
    811812        }
     
    817818          save_associations();
    818819        }
    819         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     820        free(temp.pszCmdLine);
    820821      }
    821822      break;
     
    853854          save_associations();
    854855        }
    855         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     856        free(temp.pszCmdLine);
    856857      }
    857858
     
    875876        pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    876877        if (!pszWorkBuf) {
    877           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     878          free(temp.pszCmdLine);
    878879          break; //already complained
    879880        }
     
    884885          memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);
    885886        }
    886         xfree(pszWorkBuf, pszSrcFile, __LINE__);
     887        free(pszWorkBuf);
    887888        WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig);
    888889        rstrip(temp.sig);
     
    911912        if (fCancelAction){
    912913          fCancelAction = FALSE;
    913           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     914          free(temp.pszCmdLine);
    914915          break;
    915916        }
     
    920921          save_associations();
    921922        }
    922         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     923        free(temp.pszCmdLine);
    923924      }
    924925      {
     
    957958          save_associations();
    958959        }
    959         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     960        free(temp.pszCmdLine);
    960961      }
    961962      break;
  • trunk/dll/autoview.c

    r1038 r1039  
    415415                      WinSetWindowText(hwndAutoview, obuff);
    416416                  }
    417                   xfree(obuff, pszSrcFile, __LINE__);
     417                  free(obuff);
    418418                }
    419                 xfree(ibuff, pszSrcFile, __LINE__);
     419                free(ibuff);
    420420              }
    421421              DosClose(handle);
     
    510510                if (*pszBuf)
    511511                  WinSetWindowText(hwndAutoview, pszBuf);
    512                 xfree(pszBuf, pszSrcFile, __LINE__);
     512                free(pszBuf);
    513513              }
    514514            }
     
    544544              rc = DosQueryPathInfo((CHAR *)mp1, FIL_QUERYEASFROMLIST,
    545545                                    (PVOID) & eaop, (ULONG) sizeof(EAOP2));
    546               xfree(pgealist, pszSrcFile, __LINE__);
     546              free(pgealist);
    547547              if (!rc) {
    548548                pfea = &eaop.fpFEA2List->list[0];
     
    594594                      }
    595595                      WinSetWindowText(hwndAutoMLE, pszBuf);
    596                       xfree(pszBuf, pszSrcFile, __LINE__);
     596                      free(pszBuf);
    597597                    }
    598598                  }
     
    608608                MLEsetreadonly(hwndAutoMLE, FALSE);
    609609              }
    610               xfree(pfealist, pszSrcFile, __LINE__);
     610              free(pfealist);
    611611            }
    612612          }
    613613        }
    614614      }
    615       xfree((CHAR *)mp1, pszSrcFile, __LINE__);
     615      free((CHAR *)mp1);
    616616# ifdef FORTIFY
    617617  Fortify_LeaveScope();
     
    798798              PutComments(hwnd, currfile, ea);
    799799              PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
    800               xfree(ea, pszSrcFile, __LINE__);
     800              free(ea);
    801801# ifdef FORTIFY
    802802  Fortify_LeaveScope();
     
    851851          stopflag++;
    852852          if (!PostMsg(hwndAutoObj, UM_LOADFILE, MPFROMP(cf), MPVOID))
    853             xfree(cf, pszSrcFile, __LINE__);
     853            free(cf);
    854854# ifdef FORTIFY
    855855  Fortify_LeaveScope();
  • trunk/dll/avl.c

    r1029 r1039  
    5151#include "errutil.h"                    // Runtime_Error
    5252#include "fm3dll.h"
     53#include "fortify.h"
    5354
    5455static PSZ pszSrcFile = __FILE__;
     
    265266    xfree(pat->createwdirs, pszSrcFile, __LINE__);
    266267    xfree(pat->movewdirs, pszSrcFile, __LINE__);
    267     xfree(pat, pszSrcFile, __LINE__);
     268    free(pat);
    268269  }
    269270}
     
    851852                         ArcReviewDlgProc,
    852853                         FM3ModHandle, AD_FRAME, MPFROMP(&ad))) {
    853             xfree(ad.info, pszSrcFile, __LINE__);
     854            free(ad.info);
    854855          }
    855856          else {
  • trunk/dll/avv.c

    r1009 r1039  
    4242#include "fm3dll.h"
    4343#include "pathutil.h"                   // NormalizeCmdLine
     44#include "fortify.h"
    4445
    4546#pragma data_seg(DATA1)
     
    105106      NormalizeCmdLine(pszWorkBuf, szCmdLine);
    106107      pszDest = xstrdup(pszWorkBuf, pszSrcFile, __LINE__);
    107       xfree(pszWorkBuf, pszSrcFile, __LINE__);
     108      free(pszWorkBuf);
    108109    }
    109110    else
    110111      pszDest = xstrdup(szCmdLine, pszSrcFile, __LINE__); // return the unexamined input on failure
    111     xfree(szCmdLine, pszSrcFile, __LINE__);
     112    free(szCmdLine);
    112113  }
    113114  else
  • trunk/dll/cmdline.c

    r1009 r1039  
    3737#include "fm3dll.h"
    3838#include "pathutil.h"                   // MaxCmdLineStr
     39#include "fortify.h"
    3940
    4041static PSZ pszSrcFile = __FILE__;
     
    8889            info->cmdline = xstrdup(pszCmdLine, pszSrcFile, __LINE__);
    8990            if (!info->cmdline)
    90               xfree(info, pszSrcFile, __LINE__);
     91              free(info);
    9192            else {
    9293              info->next = NULL;
     
    102103      fclose(fp);
    103104    }
     105    free(pszCmdLine);
    104106  }
    105   xfree(pszCmdLine, pszSrcFile, __LINE__);
    106107  if (DoItYourself)
    107108    DoItYourselfCmdLine = CmdLineHead;
     
    185186        info = CmdLineHead;
    186187        CmdLineHead = CmdLineHead->next;
    187         xfree(info, pszSrcFile, __LINE__);
     188        free(info);
    188189      }
    189190      if (DoItYourself)
     
    214215        CmdLineHead = info->next;
    215216      xfree(info->cmdline, pszSrcFile, __LINE__);
    216       xfree(info, pszSrcFile, __LINE__);
     217      free(info);
    217218      if (DoItYourself)
    218219        DoItYourselfCmdLine = CmdLineHead;
     
    236237    next = info->next;
    237238    xfree(info->cmdline, pszSrcFile, __LINE__);
    238     xfree(info, pszSrcFile, __LINE__);
     239    free(info);
    239240    info = next;
    240241  }
  • trunk/dll/collect.c

    r1037 r1039  
    907907            Runtime_Error(pszSrcFile, __LINE__,
    908908                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    909             xfree(wk, pszSrcFile, __LINE__);
     909            free(wk);
    910910# ifdef FORTIFY
    911911  Fortify_LeaveScope();
     
    940940            Runtime_Error(pszSrcFile, __LINE__,
    941941                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    942             xfree(wk, pszSrcFile, __LINE__);
     942            free(wk);
    943943# ifdef FORTIFY
    944944  Fortify_LeaveScope();
     
    968968      WinSendMsg(dcd->hwndCnr, UM_CLOSE, MPVOID, MPVOID);
    969969      FreeList(dcd->lastselection);
    970       xfree(dcd, pszSrcFile, __LINE__);
     970      free(dcd);
    971971# ifdef FORTIFY
    972972  Fortify_LeaveScope();
     
    14671467    if (mp1) {
    14681468      if (!dcd) {
    1469         xfree(mp1, pszSrcFile, __LINE__);
     1469        free(mp1);
    14701470# ifdef FORTIFY
    14711471  Fortify_LeaveScope();
     
    14761476        if (!PostMsg(dcd->hwndObject, UM_COLLECTFROMFILE, mp1, mp2)) {
    14771477          Runtime_Error(pszSrcFile, __LINE__, "PostMsg");
    1478           xfree(mp1, pszSrcFile, __LINE__);
     1478          free(mp1);
    14791479# ifdef FORTIFY
    14801480  Fortify_LeaveScope();
     
    16051605            if (p) {
    16061606              if (!PostMsg(hwnd, UM_COLLECTFROMFILE, MPFROMP(p), MPVOID))
    1607                 xfree(p, pszSrcFile, __LINE__);
     1607                free(p);
    16081608# ifdef FORTIFY
    16091609  Fortify_LeaveScope();
     
    21242124            }
    21252125            else
    2126               xfree(li, pszSrcFile, __LINE__);
     2126              free(li);
    21272127# ifdef FORTIFY
    21282128  Fortify_LeaveScope();
     
    26912691        hwnd = StartMLEEditor(dcd->hwndParent,
    26922692                              (INT)mp1, (CHAR *)mp2, dcd->hwndFrame);
    2693       xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     2693      free((CHAR *)mp2);
    26942694      return MRFROMLONG(hwnd);
    26952695    }
     
    28842884                   IDS_WINCREATEWINDOW);
    28852885        PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    2886         xfree(dcd, pszSrcFile, __LINE__);
     2886        free(dcd);
    28872887# ifdef FORTIFY
    28882888  Fortify_LeaveScope();
  • trunk/dll/command.c

    r1009 r1039  
    4444#include "pathutil.h"                   // NormalizeCmdLine
    4545#include "command.h"
     46#include "fortify.h"
    4647
    4748typedef struct
     
    310311    xfree(info->title, pszSrcFile, __LINE__);
    311312    xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    312     xfree(info, pszSrcFile, __LINE__);
     313    free(info);
    313314    info = next;
    314315  }
     
    360361            xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    361362            xfree(info->title, pszSrcFile, __LINE__);
    362             xfree(info, pszSrcFile, __LINE__);
     363            free(info);
    363364            break;
    364365          }
     
    372373        }
    373374      }
    374       xfree(pszCmdLine, pszSrcFile, __LINE__);
     375      free(pszCmdLine);
    375376      fclose(fp);
    376377    }
     
    429430    xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    430431    xfree(info->title, pszSrcFile, __LINE__);
    431     xfree(info, pszSrcFile, __LINE__);
     432    free(info);
    432433    return NULL;
    433434  }
     
    466467        xfree(info->pszCmdLine, pszSrcFile, __LINE__);
    467468        xfree(info->title, pszSrcFile, __LINE__);
    468         xfree(info, pszSrcFile, __LINE__);
     469        free(info);
    469470        return TRUE;
    470471      }
     
    635636        pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    636637        if (!pszWorkBuf) {
    637           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     638          free(temp.pszCmdLine);
    638639          break; //already complained
    639640        }
     
    641642        NormalizeCmdLine(pszWorkBuf, temp.pszCmdLine);
    642643        memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);
    643         xfree(pszWorkBuf, pszSrcFile, __LINE__);
     644        free(pszWorkBuf);
    644645        if (!strchr(temp.pszCmdLine, '%')){
    645646          ret = saymsg(MB_YESNO,
     
    669670        if (fCancelAction){
    670671          fCancelAction = FALSE;
    671           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     672          free(temp.pszCmdLine);
    672673          break;
    673674        }
     
    708709          }
    709710        }
    710         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     711        free(temp.pszCmdLine);
    711712      }
    712713      x = (SHORT) WinSendDlgItemMsg(hwnd,
     
    740741        pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    741742        if (!pszWorkBuf) {
    742           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     743          free(temp.pszCmdLine);
    743744          break; //already complained
    744745        }
     
    746747        NormalizeCmdLine(pszWorkBuf, temp.pszCmdLine);
    747748        memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);
    748         xfree(pszWorkBuf, pszSrcFile, __LINE__);
     749        free(pszWorkBuf);
    749750        if (!strchr(temp.pszCmdLine, '%')){
    750751          ret = saymsg(MB_YESNO,
     
    774775        if (fCancelAction){
    775776          fCancelAction = FALSE;
    776           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     777          free(temp.pszCmdLine);
    777778          break;
    778779        }
     
    809810          }
    810811        }
    811         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     812        free(temp.pszCmdLine);
    812813      }
    813814      break;
     
    853854        temp.pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
    854855        if (!temp.pszCmdLine) {
    855           xfree(pszWorkBuf, pszSrcFile, __LINE__);
     856          free(pszWorkBuf);
    856857          break; //already complained
    857858        }
     
    859860        NormalizeCmdLine(pszWorkBuf, temp.pszCmdLine);
    860861        memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);
    861         xfree(pszWorkBuf, pszSrcFile, __LINE__);
     862        free(pszWorkBuf);
    862863        if (fCancelAction){
    863864          fCancelAction = FALSE;
    864           xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     865          free(temp.pszCmdLine);
    865866          break;
    866867        }
     
    976977          }
    977978        }
    978         xfree(temp.pszCmdLine, pszSrcFile, __LINE__);
     979        free(temp.pszCmdLine);
    979980      }
    980981      break;
  • trunk/dll/common.c

    r1009 r1039  
    4141#include "strutil.h"                    // GetPString
    4242#include "fm3dll.h"
     43#include "fortify.h"
    4344
    4445#pragma data_seg(DATA1)
     
    746747          Broadcast(WinQueryAnchorBlock(hwnd),
    747748                    dcd->hwndParent, UM_UPDATERECORD, mp2, MPVOID);
    748           xfree(mp2, pszSrcFile, __LINE__);
     749          free(mp2);
    749750        }
    750751      }
  • trunk/dll/comp.c

    r1038 r1039  
    146146        DosFindClose(hdir);
    147147      }
    148       xfree(mask, pszSrcFile, __LINE__);
     148      free(mask);
    149149    }
    150     xfree(pffb, pszSrcFile, __LINE__);
     150    free(pffb);
    151151  }
    152152}
     
    180180      }
    181181    }
    182     xfree(sf, pszSrcFile, __LINE__);
     182    free(sf);
    183183  }
    184184}
     
    691691    // PostMsg(cmp->hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DESELECTALL, 0), MPVOID);        // 18 Jan 08 SHL we can count now
    692692    DecrThreadUsage();
    693     xfree(cmp, pszSrcFile, __LINE__);
     693    free(cmp);
    694694    WinTerminate(hab);
    695695# ifdef FORTIFY
     
    756756    }
    757757    DecrThreadUsage();
    758     xfree(cmp, pszSrcFile, __LINE__);
     758    free(cmp);
    759759    WinTerminate(hab);
    760760# ifdef FORTIFY
     
    763763  }
    764764  else
    765     xfree(cmp, pszSrcFile, __LINE__);
     765    free(cmp);
    766766}
    767767
     
    808808  pciSa = xmalloc(sizeof(PCNRITEM) * numS, pszSrcFile, __LINE__);
    809809  if (!pciSa) {
    810     xfree(pciDa, pszSrcFile, __LINE__);
     810    free(pciDa);
    811811    return;
    812812  }
     
    841841      goto Restart;
    842842    }
    843     xfree(pciDa, pszSrcFile, __LINE__);
    844     xfree(pciSa, pszSrcFile, __LINE__);
     843    free(pciDa);
     844    free(pciSa);
    845845    Runtime_Error(pszSrcFile, __LINE__, "numD %u != x %lu", numD, x);
    846846    return;
     
    868868      goto Restart;
    869869    }
    870     xfree(pciSa, pszSrcFile, __LINE__);
    871     xfree(pciDa, pszSrcFile, __LINE__);
     870    free(pciSa);
     871    free(pciDa);
    872872    Runtime_Error(pszSrcFile, __LINE__, "numS (%lu) != x (%lu)", numS, x);
    873873    return;
     
    13121312  }
    13131313
    1314   xfree(pciSa, pszSrcFile, __LINE__);
    1315   xfree(pciDa, pszSrcFile, __LINE__);
     1314  free(pciSa);
     1315  free(pciDa);
    13161316
    13171317  if (fUpdateHideButton) {
     
    13541354  pffbArray = xmalloc(ulBufBytes, pszSrcFile, __LINE__);
    13551355  if (!pffbArray) {
    1356     xfree(maskstr, pszSrcFile, __LINE__);
     1356    free(maskstr);
    13571357    return;
    13581358  }
     
    14021402            // Complain if pathnames exceeds max
    14031403            DosFindClose(hDir);
    1404             xfree(pffbArray, pszSrcFile, __LINE__);
    1405             xfree(maskstr, pszSrcFile, __LINE__);
     1404            free(pffbArray);
     1405            free(maskstr);
    14061406            if (!fDone) {
    14071407              fDone = TRUE;
     
    20972097    WinTerminate(hab);
    20982098  }
    2099   xfree(cmp, pszSrcFile, __LINE__);
     2099  free(cmp);
    21002100  DosPostEventSem(CompactSem);
    21012101
     
    26652665                        GetPString(IDS_COULDNTSTARTTHREADTEXT));
    26662666          WinDismissDlg(hwnd, 0);
    2667           xfree(forthread, pszSrcFile, __LINE__);
     2667          free(forthread);
    26682668# ifdef FORTIFY
    26692669  Fortify_LeaveScope();
     
    29482948              Runtime_Error(pszSrcFile, __LINE__,
    29492949                            GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2950               xfree(sf, pszSrcFile, __LINE__);
     2950              free(sf);
    29512951            }
    29522952          }
     
    30003000            Runtime_Error(pszSrcFile, __LINE__,
    30013001                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    3002             xfree(forthread, pszSrcFile, __LINE__);
     3002            free(forthread);
    30033003          }
    30043004          else {
     
    31233123            Runtime_Error(pszSrcFile, __LINE__,
    31243124                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    3125             xfree(forthread, pszSrcFile, __LINE__);
     3125            free(forthread);
    31263126          }
    31273127          else {
     
    32793279          WinSendMsg(cmp->dcd.hwndObject, WM_CLOSE, MPVOID, MPVOID);
    32803280      }
    3281       xfree(cmp, pszSrcFile, __LINE__);
     3281      free(cmp);
    32823282    }
    32833283    EmptyCnr(hwndLeft);
  • trunk/dll/copyf.c

    r1009 r1039  
    3636#include "strutil.h"                    // GetPString
    3737#include "fm3dll.h"
     38#include "fortify.h"
    3839
    3940static PSZ pszSrcFile = __FILE__;
     
    237238          longname[CCHMAXPATH - 1] = 0;
    238239        }
    239         xfree(pfealist, pszSrcFile, __LINE__);
    240       }
    241       xfree(pgealist, pszSrcFile, __LINE__);
     240        free(pfealist);
     241      }
     242      free(pgealist);
    242243    }
    243244  }
     
    712713        /* under no circumstances! */
    713714        Runtime_Error(pszSrcFile, __LINE__, "bad name %s", str);
    714         xfree(str, pszSrcFile, __LINE__);
     715        free(str);
    715716        return -1;
    716717      }
     
    739740    xfree(ss, pszSrcFile, __LINE__);
    740741    xfree(f, pszSrcFile, __LINE__);
    741     xfree(str, pszSrcFile, __LINE__);
     742    free(str);
    742743    return -1;
    743744  }
     
    784785  }
    785786
    786   xfree(f, pszSrcFile, __LINE__);
    787   xfree(ss, pszSrcFile, __LINE__);
    788   xfree(str, pszSrcFile, __LINE__);
     787  free(f);
     788  free(ss);
     789  free(str);
    789790  return 0;
    790791}
     
    833834    xfree(ss, pszSrcFile, __LINE__);
    834835    xfree(f, pszSrcFile, __LINE__);
    835     xfree(str, pszSrcFile, __LINE__);
     836    free(str);
    836837    return -1;
    837838  }
     
    857858  }
    858859
    859   xfree(f, pszSrcFile, __LINE__);
    860   xfree(ss, pszSrcFile, __LINE__);
    861   xfree(str, pszSrcFile, __LINE__);
     860  free(f);
     861  free(ss);
     862  free(str);
    862863  return 0;
    863864}
  • trunk/dll/dircnrs.c

    r1038 r1039  
    10051005            Runtime_Error(pszSrcFile, __LINE__,
    10061006                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    1007             xfree(wk, pszSrcFile, __LINE__);
     1007            free(wk);
    10081008            FreeListInfo((LISTINFO *) mp1);
    10091009# ifdef FORTIFY
     
    10401040            Runtime_Error(pszSrcFile, __LINE__,
    10411041                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    1042             xfree(wk, pszSrcFile, __LINE__);
     1042            free(wk);
    10431043            FreeListInfo((LISTINFO *) mp1);
    10441044# ifdef FORTIFY
     
    25632563            }
    25642564            else
    2565               xfree(li, pszSrcFile, __LINE__);
     2565              free(li);
    25662566          }
    25672567        }
     
    33563356                        SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);
    33573357      FreeList(dcd->lastselection);
    3358       xfree(dcd, pszSrcFile, __LINE__);
     3358      free(dcd);
    33593359      WinSetWindowPtr(hwnd, QWL_USER, NULL);
    33603360      DosPostEventSem(CompactSem);
     
    34943494                     IDS_WINCREATEWINDOW);
    34953495          PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    3496           xfree(dcd, pszSrcFile, __LINE__);
     3496          free(dcd);
    34973497# ifdef FORTIFY
    34983498  Fortify_LeaveScope();
  • trunk/dll/dirsize.c

    r1038 r1039  
    154154      strlen(pszFileName) < 4) {
    155155    if (*pchStopFlag) {
    156       xfree(pffbArray, pszSrcFile, __LINE__);
     156      free(pffbArray);
    157157      return FALSE;
    158158    }
  • trunk/dll/draglist.c

    r1032 r1039  
    356356          if (pDItem->hstrTargetName)
    357357            DrgDeleteStrHandle(pDItem->hstrTargetName);
    358           xfree(pDItem, pszSrcFile, __LINE__);
     358          free(pDItem);
    359359          // Last item not yet count so only decrement by one less than loop count
    360360          // Unhilite code will adjust this when unhighliting
     
    425425        if (pDItem->hstrTargetName)
    426426          DrgDeleteStrHandle(pDItem->hstrTargetName);
    427         xfree(pDItem, pszSrcFile, __LINE__);
     427        free(pDItem);
    428428        dcd->ulItemsToUnHilite = ulNumfiles + 1;        // +1 to ensure non-zero
    429429        break;
     
    471471            if (pDItem->hstrTargetName)
    472472              DrgDeleteStrHandle(pDItem->hstrTargetName);
    473             xfree(pDItem, pszSrcFile, __LINE__);
     473            free(pDItem);
    474474            // Last item not yet count so only decrement by one less than loop count
    475475            if (c > 1) {
     
    562562      FreeDragInfoData(hwndCnr, pDInfo);
    563563  }
    564 
    565   if (ppDItem)
    566     xfree(ppDItem, pszSrcFile, __LINE__);
     564  xfree(ppDItem, pszSrcFile, __LINE__);
    567565  if (paDImgIcons && paDImgIcons != &dimgFakeIcon)
    568     xfree(paDImgIcons, pszSrcFile, __LINE__);
     566    free(paDImgIcons);
    569567  DosPostEventSem(CompactSem);
    570568  MarkAll(hwndCnr, TRUE, FALSE, TRUE);
     
    678676        if (pDItem->hstrTargetName)
    679677          DrgDeleteStrHandle(pDItem->hstrTargetName);
    680         xfree(pDItem, pszSrcFile, __LINE__);
     678        free(pDItem);
    681679        // pDItem = NULL;       // Why bother, we can count - fixme to be gone
    682680        dcd->ulItemsToUnHilite = ulNumfiles + 1;
  • trunk/dll/eas.c

    r1029 r1039  
    4141#include "strutil.h"                    // GetPString
    4242#include "fm3dll.h"
     43#include "fortify.h"
    4344
    4445#pragma data_seg(DATA1)
     
    867868                    memcpy(pfea, pfealist->list,
    868869                           pfealist->cbList - sizeof(ULONG));
    869                     xfree(eap->current->pfea, pszSrcFile, __LINE__);
     870                    free(eap->current->pfea);
    870871                    eap->current->pfea = pfea;
    871872                    eap->current->name = eap->current->pfea->szName;
     
    881882                }
    882883              }
    883               xfree(s, pszSrcFile, __LINE__);
     884              free(s);
    884885            }
    885886          }
     
    912913          rc = xDosSetPathInfo(eap->filename, FIL_QUERYEASIZE,
    913914                               &eaop, sizeof(eaop), DSPI_WRTTHRU);
    914           xfree(pfealist, pszSrcFile, __LINE__);
     915          free(pfealist);
    915916          if (rc)
    916917            Dos_Error(MB_CANCEL, rc, hwnd, pszSrcFile, __LINE__,
     
    920921            if (eap->current == eap->head) {
    921922              eap->head = eap->head->next;
    922               xfree(eap->current->pfea, pszSrcFile, __LINE__);
    923               xfree(eap->current, pszSrcFile, __LINE__);
     923              free(eap->current->pfea);
     924              free(eap->current);
    924925              eap->current = NULL;
    925926            }
     
    930931                  sSelect++;
    931932                  info->next = eap->current->next;
    932                   xfree(eap->current->pfea, pszSrcFile, __LINE__);
    933                   xfree(eap->current, pszSrcFile, __LINE__);
     933                  free(eap->current->pfea);
     934                  free(eap->current);
    934935                  eap->current = NULL;
    935936                  break;
     
    987988      if (eap->head)
    988989        Free_FEAList(eap->head);
    989       xfree(eap, pszSrcFile, __LINE__);
     990      free(eap);
    990991      if (hptrIcon)
    991992        WinDestroyPointer(hptrIcon);
     
    12761277                }
    12771278              }
    1278               xfree(pfealist, pszSrcFile, __LINE__);
     1279              free(pfealist);
    12791280            }
    1280             xfree(pgealist, pszSrcFile, __LINE__);
     1281            free(pgealist);
    12811282          }
    12821283          ulEntry += ulCount;
    12831284        } // while
    1284         xfree(pdena, pszSrcFile, __LINE__);
     1285        free(pdena);
    12851286        DosPostEventSem(CompactSem);
    12861287      }
     
    13501351                }
    13511352                else
    1352                   xfree(pfealist, pszSrcFile, __LINE__);
     1353                  free(pfealist);
    13531354              }
    13541355              else {
    1355                 xfree(pfealist, pszSrcFile, __LINE__);
     1356                free(pfealist);
    13561357                if (!silentfail) {
    13571358                  if (rc == ERROR_ACCESS_DENIED
     
    13631364                             pdena->szName);
    13641365                    if (rc == MBID_CANCEL) {
    1365                       xfree(pgealist, pszSrcFile, __LINE__);
     1366                      free(pgealist);
    13661367                      break;
    13671368                    }
     
    13781379              }
    13791380            }
    1380             xfree(pgealist, pszSrcFile, __LINE__);
     1381            free(pgealist);
    13811382          }
    13821383          ulEntry += ulCount;
    13831384        } // while
    1384         xfree(pdena, pszSrcFile, __LINE__);
     1385        free(pdena);
    13851386        DosPostEventSem(CompactSem);
    13861387      }
     
    14001401    next = pFEA->next;
    14011402    xfree(pFEA->pfea, pszSrcFile, __LINE__);
    1402     xfree(pFEA, pszSrcFile, __LINE__);
     1403    free(pFEA);
    14031404    pFEA = next;
    14041405  }
  • trunk/dll/filldir.c

    r1038 r1039  
    309309            pci->pszSubject = xstrdup(value + (sizeof(USHORT) * 2), pszSrcFile, __LINE__);
    310310        }
    311         xfree(pfealist, pszSrcFile, __LINE__);
    312       }
    313       xfree(pgealist, pszSrcFile, __LINE__);
     311        free(pfealist);
     312      }
     313      free(pgealist);
    314314    }
    315315  }
     
    356356            pci->pszLongName = xstrdup(value + (sizeof(USHORT) * 2), pszSrcFile, __LINE__);
    357357        }
    358         xfree(pfealist, pszSrcFile, __LINE__);
    359       }
    360       xfree(pgealist, pszSrcFile, __LINE__);
     358        free(pfealist);
     359      }
     360      free(pgealist);
    361361    }
    362362  }
     
    538538            pci->pszSubject = xstrdup(value + (sizeof(USHORT) * 2), pszSrcFile, __LINE__);
    539539        }
    540         xfree(pfealist, pszSrcFile, __LINE__);
    541       }
    542       xfree(pgealist, pszSrcFile, __LINE__);
     540        free(pfealist);
     541      }
     542      free(pgealist);
    543543    }
    544544  }
     
    586586          }
    587587        }
    588         xfree(pfealist, pszSrcFile, __LINE__);
    589       }
    590       xfree(pgealist, pszSrcFile, __LINE__);
     588        free(pfealist);
     589      }
     590      free(pgealist);
    591591    }
    592592  }
  • trunk/dll/filter.c

    r1009 r1039  
    3131#include "strutil.h"                    // GetPString
    3232#include "fm3dll.h"
     33#include "fortify.h"
    3334
    3435#pragma data_seg(FILTER_DATA)
     
    154155          }
    155156          else
    156             xfree(info, pszSrcFile, __LINE__);
     157            free(info);
    157158        }
    158159      }
     
    218219    }
    219220    else
    220       xfree(info, pszSrcFile, __LINE__);
     221      free(info);
    221222  }
    222223}
     
    239240        maskhead = info->next;
    240241      xfree(info->mask, pszSrcFile, __LINE__);
    241       xfree(info, pszSrcFile, __LINE__);
     242      free(info);
    242243      break;
    243244    }
  • trunk/dll/grep.c

    r1038 r1039  
    616616            else if (!InsertDupe(grep, szFindPath, pffbFile)) {
    617617              DosFindClose(findHandle);
    618               xfree(pffbArray, pszSrcFile, __LINE__);
     618              free(pffbArray);
    619619# ifdef FORTIFY
    620620  Fortify_LeaveScope();
     
    645645  }
    646646
    647   xfree(pffbArray, pszSrcFile, __LINE__);
     647  free(pffbArray);
    648648# ifdef FORTIFY
    649649  Fortify_LeaveScope();
     
    661661        free(grep->insertffb[x]);
    662662      }
    663       xfree(grep->insertffb, pszSrcFile, __LINE__);
     663      free(grep->insertffb);
    664664    }
    665665    if (grep->dir) {
     
    667667        free(grep->dir[x]);
    668668      }
    669       xfree(grep->dir, pszSrcFile, __LINE__);
     669      free(grep->dir);
    670670    }
    671671    grep->dir = NULL;
     
    782782                             pszSrcFile, __LINE__);
    783783        if (!grep->dir) {
    784           xfree(grep->insertffb, pszSrcFile, __LINE__);
     784          free(grep->insertffb);
    785785# ifdef FORTIFY
    786786  Fortify_LeaveScope();
     
    798798      grep->dir[grep->toinsert] = xstrdup(szDirectory, pszSrcFile, __LINE__);
    799799      if (!grep->dir) {
    800         xfree(grep->insertffb[grep->toinsert], pszSrcFile, __LINE__);
     800        free(grep->insertffb[grep->toinsert]);
    801801# ifdef FORTIFY
    802802  Fortify_LeaveScope();
     
    10181018        fclose(inputFile);
    10191019      }
    1020       xfree(input, pszSrcFile, __LINE__);
     1020      free(input);
    10211021# ifdef FORTIFY
    10221022  Fortify_LeaveScope();
     
    11351135      // DosSleep(1);                   // 07 Feb 08 SHL
    11361136    }
    1137     xfree(buffer, pszSrcFile, __LINE__);
     1137    free(buffer);
    11381138# ifdef FORTIFY
    11391139  Fortify_LeaveScope();
     
    16281628    info->name = xstrdup(dir, pszSrcFile, __LINE__);
    16291629    if (!info->name) {
    1630       xfree(info, pszSrcFile, __LINE__);
     1630      free(info);
    16311631# ifdef FORTIFY
    16321632  Fortify_LeaveScope();
  • trunk/dll/grep2.c

    r1029 r1039  
    825825          DosBeep(50, 100);
    826826          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, GREP_MASK));
    827           xfree(p, pszSrcFile, __LINE__);
     827          free(p);
    828828# ifdef FORTIFY
    829829  Fortify_LeaveScope();
     
    927927          Runtime_Error(pszSrcFile, __LINE__,
    928928                        GetPString(IDS_COULDNTSTARTTHREADTEXT));
    929           xfree(p, pszSrcFile, __LINE__);
     929          free(p);
    930930# ifdef FORTIFY
    931931  Fortify_LeaveScope();
     
    935935        }
    936936        DosSleep(100); //05 Aug 07 GKY 128
    937         xfree(p, pszSrcFile, __LINE__);
     937        free(p);
    938938# ifdef FORTIFY
    939939  Fortify_LeaveScope();
  • trunk/dll/info.c

    r1009 r1039  
    4444#include "strutil.h"                    // GetPString
    4545#include "fm3dll.h"
     46#include "fortify.h"
    4647
    4748#pragma data_seg(DATA1)
     
    464465      if (pis->lasthwndMenu)
    465466        WinDestroyWindow(pis->lasthwndMenu);
    466       xfree(pis, pszSrcFile, __LINE__);
     467      free(pis);
    467468      return oldproc(hwnd, msg, mp1, mp2);
    468469    }
  • trunk/dll/inis.c

    r1038 r1039  
    217217                                                        app2 : inirec->app),
    218218                                                pCurrentK, pData, ulSize);
    219                           xfree(pData, pszSrcFile, __LINE__);   /* free data */
     219                          free(pData);  /* free data */
    220220                        }
    221221                      }
     
    225225                    }
    226226                  }
    227                   xfree(pDataK, pszSrcFile, __LINE__);          /* free keynames */
     227                  free(pDataK);         /* free keynames */
    228228                }
    229229              }
     
    261261                                         inirec->key2 : inirec->key),
    262262                                        pData, ulSize);
    263                   xfree(pData, pszSrcFile, __LINE__);           /* free data */
     263                  free(pData);          /* free data */
    264264                }
    265265              }
     
    296296      PostMsg(inirec->hwndSource, WM_COMMAND, MPFROM2SHORT(INI_REFRESH, 0),
    297297              MPVOID);
    298     xfree(inirec, pszSrcFile, __LINE__);
     298    free(inirec);
    299299# ifdef FORTIFY
    300300    Fortify_LeaveScope();
     
    324324      WinTerminate(hab2);
    325325    }
    326     xfree(inirec, pszSrcFile, __LINE__);
     326    free(inirec);
    327327  }
    328328}
     
    413413                                                      pCurrentK, pData,
    414414                                                      ulSize);
    415                                 xfree(pData, pszSrcFile, __LINE__);     /* free data */
     415                                free(pData);    /* free data */
    416416                              }
    417417                            }
     
    421421                          }
    422422                        }
    423                         xfree(pDataK, pszSrcFile, __LINE__);    /* free keynames */
     423                        free(pDataK);   /* free keynames */
    424424                      }
    425425                    }
     
    429429                  }
    430430                }
    431                 xfree(pDataA, pszSrcFile, __LINE__);            /* free applnames */
     431                free(pDataA);           /* free applnames */
    432432              }
    433433            }
     
    443443    xfree(prfp->pszUserName, pszSrcFile, __LINE__);
    444444    xfree(prfp->pszSysName, pszSrcFile, __LINE__);
    445     xfree(prfp, pszSrcFile, __LINE__);
     445    free(prfp);
    446446# ifdef FORTIFY
    447447    Fortify_LeaveScope();
     
    479479        WinEnableWindowUpdate(hwndList, TRUE);
    480480      }
    481       xfree(pData, pszSrcFile, __LINE__);
     481      free(pData);
    482482    }
    483483  }
     
    538538        Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
    539539                  "PrfQueryProfileString");
    540         xfree(pData, pszSrcFile, __LINE__);
     540        free(pData);
    541541      }
    542542      else {
     
    553553                   MPFROMSHORT(TRUE));
    554554        WinEnableWindowUpdate(hwndList, TRUE);
    555         xfree(pData, pszSrcFile, __LINE__);
     555        free(pData);
    556556        return TRUE;
    557557      }
     
    13301330            fixup(inidata->data, p, l, inidata->datalen);
    13311331            WinSetDlgItemText(hwnd, IAD_DATA, p);
    1332             xfree(p, pszSrcFile, __LINE__);
     1332            free(p);
    13331333          }
    13341334        }
     
    14931493    hINI = PrfOpenProfile(useHab, filename);
    14941494    if (hINI == NULLHANDLE) {
    1495       xfree(filename, pszSrcFile, __LINE__);
     1495      free(filename);
    14961496      return (HWND) 0;
    14971497    }
     
    15441544  }
    15451545  else
    1546     xfree(filename, pszSrcFile, __LINE__);
     1546    free(filename);
    15471547  return hwndFrame;
    15481548}
     
    20412041        inidata->hini = PrfOpenProfile(WinQueryAnchorBlock(hwnd),
    20422042                                       inidata->ininame);
    2043         xfree(mp1, pszSrcFile, __LINE__);
     2043        free(mp1);
    20442044      }
    20452045      else
     
    23582358            Runtime_Error(pszSrcFile, __LINE__,
    23592359                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2360             xfree(inirec, pszSrcFile, __LINE__);
     2360            free(inirec);
    23612361          }
    23622362        }
     
    23782378            Runtime_Error(pszSrcFile, __LINE__,
    23792379                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2380             xfree(inirec, pszSrcFile, __LINE__);
     2380            free(inirec);
    23812381          }
    23822382        }
     
    24182418                         IntraIniProc,
    24192419                         FM3ModHandle, INII_FRAME, (PVOID) inirec)) {
    2420             xfree(inirec, pszSrcFile, __LINE__);
     2420            free(inirec);
    24212421            break;
    24222422          }
     
    24242424            Runtime_Error(pszSrcFile, __LINE__,
    24252425                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2426             xfree(inirec, pszSrcFile, __LINE__);
     2426            free(inirec);
    24272427          }
    24282428        }
     
    24622462              xstrdup(inidata->ininame, pszSrcFile, __LINE__);
    24632463            if (!prfp->pszUserName)
    2464               xfree(prfp, pszSrcFile, __LINE__);
     2464              free(prfp);
    24652465            else {
    24662466              prfp->cchUserName = strlen(prfp->pszUserName);
    24672467              prfp->pszSysName = xstrdup(filename, pszSrcFile, __LINE__);
    24682468              if (!prfp->pszSysName) {
    2469                 xfree(prfp->pszUserName, pszSrcFile, __LINE__);
    2470                 xfree(prfp, pszSrcFile, __LINE__);
     2469                free(prfp->pszUserName);
     2470                free(prfp);
    24712471              }
    24722472              else {
     
    24762476                  Runtime_Error(pszSrcFile, __LINE__,
    24772477                                GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2478                   xfree(prfp->pszSysName, pszSrcFile, __LINE__);
    2479                   xfree(prfp->pszUserName, pszSrcFile, __LINE__);
    2480                   xfree(prfp, pszSrcFile, __LINE__);
     2478                  free(prfp->pszSysName);
     2479                  free(prfp->pszUserName);
     2480                  free(prfp);
    24812481                }
    24822482                else
     
    27772777        if (inidata->hini != NULLHANDLE && *inidata->ininame)
    27782778          CloseProfile(inidata->hini, FALSE);
    2779         xfree(inidata->data, pszSrcFile, __LINE__);
     2779        free(inidata->data);
    27802780        if (inidata->hwndPopup)
    27812781          WinDestroyWindow(inidata->hwndPopup);
    2782         xfree(inidata, pszSrcFile, __LINE__);
     2782        free(inidata);
    27832783      }
    27842784      if (!dontclose &&
  • trunk/dll/literal.c

    r1009 r1039  
    3232#include "errutil.h"                    // Dos_Error...
    3333#include "fm3dll.h"
     34#include "fortify.h"
    3435
    3536static PSZ pszSrcFile = __FILE__;
     
    194195  cBufBytes = pszOut - pszWork;                /* Calc string length excluding terminator */
    195196  memcpy(pszBuf, pszWork, cBufBytes + 1);        /* Overwrite including terminator */
    196   xfree(pszWork, pszSrcFile, __LINE__);
     197  free(pszWork);
    197198
    198199  return cBufBytes;                        /* Return string length */
     
    280281    return (*fstr == *fcard);
    281282}
    282 
    283 
    284 /*BOOL wildcard(const PSZ pszBuf, const PSZ pszWildCard,
    285               const BOOL fNotFileSpec)
    286 {
    287   const CHAR *fstr = pszBuf;
    288   PSZ fcard = pszWildCard;
    289   CHAR *tcard;
    290   INT wmatch = TRUE;
    291   BOOL reverse = FALSE;
    292 
    293   while (wmatch && *fcard && *fstr) {
    294     if (*fcard == '*' && fcard[strlen(fcard) - 1] == '*' && !reverse){
    295       tcard  = xstrdup(fcard + 1, __FILE__, __LINE__);
    296       tcard[strlen(tcard) - 1] = 0;
    297       if (!(strchr(tcard, '?')) && !(strchr(tcard, '*'))){
    298         if (strstr(fstr, tcard)){ //strstr match for *stuff* pattern no wildcards in "stuff"
    299           xfree(tcard, pszSrcFile, __LINE__);
    300           return TRUE;
    301         }
    302         else{
    303           xfree(tcard, pszSrcFile, __LINE__);
    304           return FALSE;
    305         }
    306       }
    307       xfree(tcard, pszSrcFile, __LINE__);
    308     }
    309     else   //reverse search for *stuff pattern "stuff" can contain wildcards
    310       if (*fcard == '*' && fcard[strlen(fcard) - 1] != '*'){
    311         fstr = strrev(pszBuf);
    312         fcard = strrev(pszWildCard);
    313         reverse = TRUE;
    314       }
    315      switch (*fcard) { //fm2 standard forward search for all other cases
    316       case '?':                                // character substitution /
    317         fcard++;
    318         if (fNotFileSpec || (*fstr != '.' && *fstr != '/' && *fstr != '\\'))
    319           fstr++;                                // skip (match) next character
    320         break;
    321 
    322       case '*':
    323         // find next non-wild character in wildcard
    324         while (*fcard && (*fcard == '?' || *fcard == '*'))
    325           fcard++;
    326         if (!*fcard){                        // if last char of wildcard is *, it matches
    327           if (reverse){
    328             fstr = strrev(pszBuf);
    329             fcard = strrev(pszWildCard);
    330           }
    331           return TRUE;
    332         }
    333         // skip until partition, match, or eos
    334         while (*fstr && toupper(*fstr) != toupper(*fcard) &&
    335                (fNotFileSpec || (*fstr != '\\' &&
    336                                  *fstr != '/' && *fstr != '.')))
    337           fstr++;
    338         if (!fNotFileSpec && !*fstr)        // implicit '.'
    339           if (*fcard == '.')
    340             fcard++;
    341         break;
    342 
    343       default:
    344         if (!fNotFileSpec && ((*fstr == '/' || *fstr == '\\') &&
    345                               (*fcard == '/' || *fcard == '\\')))
    346           wmatch = TRUE;
    347         else
    348           wmatch = (toupper(*fstr) == toupper(*fcard));
    349         fstr++;
    350         fcard++;
    351         break;
    352       }
    353   }  //while
    354 
    355   if ((*fcard && *fcard != '*') || *fstr){
    356     if (reverse){
    357       fstr = strrev(pszBuf);
    358       fcard = strrev(pszWildCard);
    359     }
    360     return 0;
    361   }
    362   else {
    363     if (reverse){
    364       fstr = strrev(pszBuf);
    365       fcard = strrev(pszWildCard);
    366     }
    367     return wmatch;
    368   }
    369 } */
    370 
    371283
    372284// fixup - quote literal character array
  • trunk/dll/mainwnd.c

    r1037 r1039  
    520520      WinSetMultWindowPos(WinQueryAnchorBlock(hwnd), &swp[2], numtools);
    521521    }
    522     xfree(swp, pszSrcFile, __LINE__);
     522    free(swp);
    523523  }
    524524  WinInvalidateRect(hwnd, NULL, TRUE);
     
    10141014              }
    10151015            }
    1016             xfree(s, pszSrcFile, __LINE__);
     1016            free(s);
    10171017          }
    10181018        }
     
    15601560        PostMsg(hwnd, UM_FOCUSME, MPVOID, MPVOID);
    15611561        PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
    1562         xfree(pszCmdLine, pszSrcFile, __LINE__);
     1562        free(pszCmdLine);
    15631563      }
    15641564    }
     
    62626262                                  MPFROMP(pszStateName),
    62636263                                  MPVOID)) {
    6264                   xfree(pszStateName, pszSrcFile, __LINE__);
     6264                  free(pszStateName);
    62656265                }
    62666266              }
     
    63366336        if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID))
    63376337          // 05 Feb 08 SHL fixme to complain?
    6338           xfree(pszDefaultStateName, pszSrcFile, __LINE__);
     6338          free(pszDefaultStateName);
    63396339      }
    63406340    }
  • trunk/dll/mainwnd2.c

    r1009 r1039  
    4848#include "command.h"                    // RunCommand
    4949#include "fm3dll.h"
     50#include "fortify.h"
    5051
    5152typedef struct
  • trunk/dll/makelist.c

    r1038 r1039  
    7575    if (li->list)
    7676      FreeList(li->list);
    77     xfree(li, pszSrcFile, __LINE__);
     77    free(li);
    7878# ifdef FORTIFY
    7979  //Fortify_LeaveScope();
     
    9696    _heap_check();
    9797#endif
    98     xfree(list, pszSrcFile, __LINE__);
     98    free(list);
    9999# ifdef FORTIFY
    100100  //Fortify_LeaveScope();
  • trunk/dll/menu.c

    r1009 r1039  
    2727#include "errutil.h"                    // Dos_Error...
    2828#include "fm3dll.h"
     29#include "fortify.h"
    2930
    3031#pragma data_seg(DATA2)
     
    6970    next = info->next;
    7071    xfree(info->text, pszSrcFile, __LINE__);
    71     xfree(info, pszSrcFile, __LINE__);
     72    free(info);
    7273    info = next;
    7374  }
     
    107108          info->text = xstrdup(tokens[2], pszSrcFile, __LINE__);
    108109          if (!info->text)
    109             xfree(info, pszSrcFile, __LINE__);
     110            free(info);
    110111          else {
    111112            if (!stricmp(tokens[0], "MENUITEM"))
     
    116117              /* error! */
    117118              xfree(info->text, pszSrcFile, __LINE__);
    118               xfree(info, pszSrcFile, __LINE__);
     119              free(info);
    119120              info = NULL;
    120121            }
  • trunk/dll/misc.c

    r1030 r1039  
    6767#include "command.h"                // LINKCMDS
    6868#include "fm3dll.h"
     69#include "fortify.h"
    6970
    7071#pragma data_seg(DATA1)
     
    232233        }
    233234      }
    234       xfree(s, pszSrcFile, __LINE__);
     235      free(s);
    235236    }
    236237    if (releaseme)
     
    851852                  if (!PostMsg(hwnd,
    852853                               UM_FIXEDITNAME, MPVOID, MPFROMP(filename)))
    853                     xfree(filename, pszSrcFile, __LINE__);
     854                    free(filename);
    854855                }
    855856                if (stricmp(testname, pci->pszFileName)) {
     
    859860                    if (!PostMsg(hwnd,
    860861                                 UM_FIXEDITNAME, MPVOID, MPFROMP(filename)))
    861                       xfree(filename, pszSrcFile, __LINE__);
     862                      free(filename);
    862863                  }
    863864                }
     
    10051006    else if (ret != 0)
    10061007      return -1;
    1007     xfree(pszCmdLine, pszSrcFile, __LINE__);
     1008    free(pszCmdLine);
    10081009  }
    10091010  return 0;
     
    19981999                                  GetPString(IDS_SUBJ) : GetPString(IDS_NAME));
    19992000    WinSetWindowText(hwnd, s);
    2000     xfree(s, pszSrcFile, __LINE__);
     2001    free(s);
    20012002  }
    20022003}
     
    20172018             !(flWindowAttr & CV_TEXT)) ? GetPString(IDS_MINI) : NullStr);
    20182019    WinSetWindowText(hwnd, s);
    2019     xfree(s, pszSrcFile, __LINE__);
     2020    free(s);
    20202021  }
    20212022}
     
    20372038      sprintf(s, "F:%s", GetPString(IDS_ALLTEXT));
    20382039    WinSetWindowText(hwnd, s);
    2039     xfree(s, pszSrcFile, __LINE__);
     2040    free(s);
    20402041  }
    20412042}
     
    21822183      }
    21832184      numswitches = y;
    2184       xfree(pswb, pszSrcFile, __LINE__);
     2185      free(pswb);
    21852186      DosPostEventSem(CompactSem);
    21862187    }
  • trunk/dll/mle.c

    r1029 r1039  
    252252    Dos_Error(MB_CANCEL, rc, h, pszSrcFile, __LINE__,
    253253              GetPString(IDS_OUTOFMEMORY));
    254     xfree(sel, pszSrcFile, __LINE__);
     254    free(sel);
    255255# ifdef FORTIFY
    256256  Fortify_LeaveScope();
     
    272272    if (sellen < 1) {
    273273      Runtime_Error(pszSrcFile, __LINE__, "len < 1");
    274       xfree(sel, pszSrcFile, __LINE__);
     274      free(sel);
    275275# ifdef FORTIFY
    276276  Fortify_LeaveScope();
     
    289289    SaveToClip(h, sel, TRUE);
    290290    DosFreeMem(temp);
    291     xfree(sel, pszSrcFile, __LINE__);
     291    free(sel);
    292292# ifdef FORTIFY
    293293  Fortify_LeaveScope();
     
    313313#endif
    314314      DosFreeMem(temp);
    315       xfree(sel, pszSrcFile, __LINE__);
     315      free(sel);
    316316# ifdef FORTIFY
    317317  Fortify_LeaveScope();
     
    389389#endif
    390390    DosFreeMem(temp);
    391     xfree(sel, pszSrcFile, __LINE__);
     391    free(sel);
    392392# ifdef FORTIFY
    393393  Fortify_LeaveScope();
     
    425425#endif
    426426  DosFreeMem(temp);
    427   xfree(sel, pszSrcFile, __LINE__);
     427  free(sel);
    428428# ifdef FORTIFY
    429429  Fortify_LeaveScope();
     
    594594          else
    595595            ret = FALSE;
    596           xfree(buffer, pszSrcFile, __LINE__);
     596          free(buffer);
    597597# ifdef FORTIFY
    598598  Fortify_LeaveScope();
     
    796796        _heap_check();
    797797#endif
    798         //xfree(bkg, pszSrcFile, __LINE__);
    799798        WinDestroyMsgQueue(thmq);
    800799      }
     800      else
     801        PostMsg(bkg->hwndReport, bkg->msg, MPVOID, MPVOID);
    801802      DecrThreadUsage();
    802803      WinTerminate(thab);
    803       xfree(bkg, pszSrcFile, __LINE__);
     804      free(bkg);
    804805      bkg = NULL;
    805806# ifdef FORTIFY
     
    809810    }
    810811    // fixme to be gone?
    811     if (bkg) {
     812    else {
    812813      PostMsg(bkg->hwndReport, bkg->msg, MPVOID, MPVOID);
    813       xfree(bkg, pszSrcFile, __LINE__);
     814      free(bkg);
    814815# ifdef FORTIFY
    815816  Fortify_LeaveScope();
  • trunk/dll/newview.c

    r1038 r1039  
    14421442                              __LINE__,
    14431443                              GetPString(IDS_ERRORREADINGTEXT), ad->filename);
    1444                     xfree(ad->text, pszSrcFile, __LINE__);
     1444                    free(ad->text);
    14451445                    ad->text = NULL;
    14461446                    ad->textsize = 0;
     
    24002400              switch (ret) {
    24012401              case 0:
    2402                 xfree(urld, pszSrcFile, __LINE__);
     2402                free(urld);
    24032403                goto NoAdd;
    24042404              case 1:
     
    24262426                            "%s %s", httprun, urld->url);
    24272427                }
    2428                 xfree(urld, pszSrcFile, __LINE__);
     2428                free(urld);
    24292429                goto NoAdd;
    24302430              case 2:
     
    24522452                            "%s %s", ftprun, urld->url);
    24532453                }
    2454                 xfree(urld, pszSrcFile, __LINE__);
     2454                free(urld);
    24552455                goto NoAdd;
    24562456              case 3:
     
    24622462                          "%s %s", mailrun, urld->url);
    24632463                }
    2464                 xfree(urld, pszSrcFile, __LINE__);
     2464                free(urld);
    24652465                goto NoAdd;
    24662466              default:
    24672467                break;
    24682468              }
    2469               xfree(urld, pszSrcFile, __LINE__);
     2469              free(urld);
    24702470            }
    24712471          }
     
    25452545                                  MPFROMLONG(whichline));
    25462546            }
    2547             xfree(s, pszSrcFile, __LINE__);
     2547            free(s);
    25482548          }
    25492549        }
     
    39583958        FreeViewerMem(hwnd);
    39593959        WinSetWindowPtr(hwnd, QWL_USER, NULL);
    3960         xfree(ad, pszSrcFile, __LINE__);
     3960        free(ad);
    39613961      }
    39623962      if (hwndRestore && hwndRestore != HWND_DESKTOP) {
  • trunk/dll/notebook.c

    r1009 r1039  
    5151#include "notebook.h"
    5252#include "fm3dll.h"
     53#include "fortify.h"
    5354
    5455#pragma data_seg(DATA2)
     
    214215      pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    215216      if (!pszWorkBuf) {
    216         xfree(szCLBuf, pszSrcFile, __LINE__);
     217        free(szCLBuf);
    217218        return 0; //already complained
    218219      }
     
    222223        NormalizeCmdLine(pszWorkBuf, szCLBuf);
    223224        memcpy(virus, pszWorkBuf, strlen(pszWorkBuf) + 1);
    224         xfree(pszWorkBuf, pszSrcFile, __LINE__);
    225         xfree(szCLBuf, pszSrcFile, __LINE__);
     225        free(pszWorkBuf);
     226        free(szCLBuf);
    226227        if (!strchr(virus, '%') && strlen(virus) > 3)
    227228          strcat(virus, " %p");
     
    487488      pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    488489      if (!pszWorkBuf) {
    489         xfree(szCLBuf, pszSrcFile, __LINE__);
     490        free(szCLBuf);
    490491        return 0; //already complained
    491492      }
     
    522523          strcat(bined, " %a");
    523524      }
    524       xfree(pszWorkBuf, pszSrcFile, __LINE__);
    525       xfree(szCLBuf, pszSrcFile, __LINE__);
     525      free(pszWorkBuf);
     526      free(szCLBuf);
    526527      PrfWriteProfileString(fmprof, appname, "Viewer", viewer);
    527528      PrfWriteProfileString(fmprof, appname, "Editor", editor);
     
    690691      pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    691692      if (!pszWorkBuf) {
    692         xfree(szCLBuf, pszSrcFile, __LINE__);
     693        free(szCLBuf);
    693694        return 0; //already complained
    694695      }
     
    723724        memcpy(mailrun, pszWorkBuf, strlen(pszWorkBuf) + 1);
    724725      }
    725       xfree(pszWorkBuf, pszSrcFile, __LINE__);
    726       xfree(szCLBuf, pszSrcFile, __LINE__);
     726      free(pszWorkBuf);
     727      free(szCLBuf);
    727728      PrfWriteProfileString(fmprof, appname, "HttpRunDir", httprundir);
    728729      PrfWriteProfileString(fmprof, appname, "FtpRunDir", ftprundir);
     
    13261327      pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    13271328      if (!pszWorkBuf) {
    1328         xfree(szCLBuf, pszSrcFile, __LINE__);
     1329        free(szCLBuf);
    13291330        return 0; //already complained
    13301331      }
     
    13461347          strcat(compare, " %a");
    13471348      }
    1348       xfree(pszWorkBuf, pszSrcFile, __LINE__);
    1349       xfree(szCLBuf, pszSrcFile, __LINE__);
     1349      free(pszWorkBuf);
     1350      free(szCLBuf);
    13501351      PrfWriteProfileString(fmprof, appname, "Compare", compare);
    13511352      break;
  • trunk/dll/notify.c

    r1038 r1039  
    198198
    199199    if (p != str)
    200       xfree(p, pszSrcFile, __LINE__);
     200      free(p);
    201201    if (id > NOTE_MAX)
    202202      id = NOTE_FRAME;
     
    275275                          LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0), mp2);
    276276        PostMsg(hwndNotify, UM_NOTIFY, MPVOID, MPVOID);
    277         xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     277        free((CHAR *)mp2);
    278278      }
    279279      WinDismissDlg(hwnd, 0);
     
    292292                        NOTE_LISTBOX,
    293293                        LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0), mp2);
    294       xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     294      free((CHAR *)mp2);
    295295    }
    296296
     
    505505            PostMsg(hwndNotify, UM_CONTAINER_FILLED, MPVOID, MPVOID);
    506506            once = TRUE;
    507           }
     507          }
     508          free(s);
    508509        }
    509         xfree(s, pszSrcFile, __LINE__);
    510510      }
    511511    }
  • trunk/dll/objcnr.c

    r1038 r1039  
    109109    if (!pciP) {
    110110      Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, "CM_ALLOCRECORD");
    111       xfree(pffbArray, pszSrcFile, __LINE__);
     111      free(pffbArray);
    112112      return;
    113113    }
     
    134134  }
    135135  else {
    136     xfree(pffbArray, pszSrcFile, __LINE__);
     136    free(pffbArray);
    137137    Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    138138              GetPString(IDS_CANTFINDDIRTEXT), filename);
     
    155155  ri.fInvalidateRecord = TRUE;
    156156  if (!WinSendMsg(hwndCnr, CM_INSERTRECORD, MPFROMP(pciP), MPFROMP(&ri))) {
    157     xfree(pffbArray, pszSrcFile, __LINE__);
     157    free(pffbArray);
    158158    return;
    159159  }
     
    204204  }
    205205
    206   xfree(pffbArray, pszSrcFile, __LINE__);
     206  free(pffbArray);
    207207  WinSendMsg(hwndCnr, CM_INVALIDATERECORD, MPFROMP(&pciP),
    208208             MPFROM2SHORT(1, 0));
     
    239239  PostMsg(WinQueryWindow(dirsize->hwndCnr, QW_PARENT), UM_CONTAINER_FILLED,
    240240          MPVOID, MPVOID);
    241   xfree(dirsize, pszSrcFile, __LINE__);
     241  free(dirsize);
    242242# ifdef FORTIFY
    243243  Fortify_LeaveScope();
     
    290290        Runtime_Error(pszSrcFile, __LINE__,
    291291                      GetPString(IDS_COULDNTSTARTTHREADTEXT));
    292         xfree(dirsize, pszSrcFile, __LINE__);
     292        free(dirsize);
    293293# ifdef FORTIFY
    294294  Fortify_LeaveScope();
  • trunk/dll/pathutil.c

    r1009 r1039  
    1616***********************************************************************/
    1717
     18#include <stdlib.h>
    1819#include <string.h>
    1920
     
    2728#include "errutil.h"                    // Dos_Error...
    2829#include "strutil.h"                    // GetPString
     30#include "fortify.h"
    2931
    3032static PSZ pszSrcFile = __FILE__;
     
    132134  szArgs = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);
    133135  if (!szArgs) {
    134     xfree(szCmdLine, pszSrcFile, __LINE__);
     136    free(szCmdLine);
    135137    return pszCmdLine_; //already complained
    136138  }
     
    333335    }
    334336  }
    335   xfree(szArgs, pszSrcFile, __LINE__);
    336   xfree(szCmdLine, pszSrcFile, __LINE__);
     337  free(szArgs);
     338  free(szCmdLine);
    337339  return pszWorkBuf;
    338340}
  • trunk/dll/presparm.c

    r1009 r1039  
    2323
    2424#include "fm3dll.h"
     25#include "fortify.h"
    2526
    2627// static PSZ pszSrcFile = __FILE__;
     
    308309                        appname, tagname, ppresparams, ppresparams->cb + 4);
    309310
    310   xfree(ppresparams, pszSrcFile, __LINE__);
     311  free(ppresparams);
    311312}
    312313
  • trunk/dll/remap.c

    r1009 r1039  
    3131#include "strutil.h"                    // GetPString
    3232#include "fm3dll.h"
     33#include "fortify.h"
    3334
    3435#pragma data_seg(DATA1)
     
    8485          info->res = xstrdup(s, pszSrcFile, __LINE__);
    8586          if (!info->res)
    86             xfree(info, pszSrcFile, __LINE__);
     87            free(info);
    8788          else {
    8889            x++;
     
    152153    info->res = xstrdup(res, pszSrcFile, __LINE__);
    153154    if (!info->res)
    154       xfree(info, pszSrcFile, __LINE__);
     155      free(info);
    155156    else {
    156157      info->next = NULL;
     
    162163        info = reshead;
    163164        reshead = reshead->next;
    164         xfree(info, pszSrcFile, __LINE__);
     165        free(info);
    165166      }
    166167      return TRUE;
     
    186187        reshead = info->next;
    187188      xfree(info->res, pszSrcFile, __LINE__);
    188       xfree(info, pszSrcFile, __LINE__);
     189      free(info);
    189190      return TRUE;
    190191    }
     
    203204    next = info->next;
    204205    xfree(info->res, pszSrcFile, __LINE__);
    205     xfree(info, pszSrcFile, __LINE__);
     206    free(info);
    206207    info = next;
    207208  }
     
    440441                   "%s", GetPString(IDS_CANTSTARTNETUSETEXT));
    441442          if (!mp2 || (ULONG) mp2 == 1041 || info->failedonce)
    442             xfree(info, pszSrcFile, __LINE__);
     443            free(info);
    443444          break;
    444445        }
     
    729730      while (info) {
    730731        next = info->next;
    731         xfree(info, pszSrcFile, __LINE__);
     732        free(info);
    732733        info = next;
    733734      }
  • trunk/dll/saveclip.c

    r1009 r1039  
    3939#include "strutil.h"                    // GetPString
    4040#include "fm3dll.h"
     41#include "fortify.h"
    4142
    4243static PSZ pszSrcFile = __FILE__;
     
    187188          p = strchr(pp, '\n');
    188189      }
    189       xfree(text, pszSrcFile, __LINE__);
     190      free(text);
    190191    }
    191192  }
     
    840841                        subject[1023] = 0;
    841842                      }
    842                       xfree(pfealist, pszSrcFile, __LINE__);
     843                      free(pfealist);
    843844                    }
    844                     xfree(pgealist, pszSrcFile, __LINE__);
     845                    free(pgealist);
    845846                  }
    846847                }
     
    883884                        longname[CCHMAXPATHCOMP - 1] = 0;
    884885                      }
    885                       xfree(pfealist, pszSrcFile, __LINE__);
     886                      free(pfealist);
    886887                    }
    887                     xfree(pgealist, pszSrcFile, __LINE__);
     888                    free(pgealist);
    888889                  }
    889890                }
  • trunk/dll/seeall.c

    r1038 r1039  
    13151315      xfree(ad->afhead[x].fullname, pszSrcFile, __LINE__);
    13161316    }
    1317     xfree(ad->afhead, pszSrcFile, __LINE__);
     1317    free(ad->afhead);
    13181318    ad->afhead = NULL;
    13191319    xfree(ad->afindex, pszSrcFile, __LINE__);
     
    19361936  pffbArray = xmalloc(ulBufBytes, pszSrcFile, __LINE__);
    19371937  if (!pffbArray) {
    1938     xfree(filename, pszSrcFile, __LINE__);
     1938    free(filename);
    19391939    return;
    19401940  }
     
    19741974            // Complain if pathnames exceeds max
    19751975            DosFindClose(hdir);
    1976             xfree(pffbArray, pszSrcFile, __LINE__);
    1977             xfree(filename, pszSrcFile, __LINE__);
     1976            free(pffbArray);
     1977            free(filename);
    19781978            if (!fDone) {
    19791979              fDone = TRUE;
     
    20422042  }
    20432043
    2044   xfree(pffbArray, pszSrcFile, __LINE__);
    2045   xfree(filename, pszSrcFile, __LINE__);
     2044  free(pffbArray);
     2045  free(filename);
    20462046}
    20472047
     
    42924292      }
    42934293      FreeAllFilesList(hwnd);
    4294       xfree(pAD, pszSrcFile, __LINE__);
     4294      free(pAD);
    42954295# ifdef FORTIFY
    42964296      Fortify_LeaveScope();
  • trunk/dll/select.c

    r1009 r1039  
    4848#include "strutil.h"                    // GetPString
    4949#include "fm3dll.h"
     50#include "fortify.h"
    5051
    5152static PSZ pszSrcFile = __FILE__;
     
    258259            fclose(inputFile);
    259260          }
    260           xfree(input, pszSrcFile, __LINE__);
     261          free(input);
    261262          DosSleep(1);
    262263        }
     
    361362            fclose(inputFile);
    362363          }
    363           xfree(input, pszSrcFile, __LINE__);
     364          free(input);
    364365          DosSleep(1);
    365366        }
  • trunk/dll/seticon.c

    r1009 r1039  
    2626#include "errutil.h"                    // Dos_Error...
    2727#include "fm3dll.h"
     28#include "fortify.h"
    2829
    2930#pragma data_seg(DATA2)
     
    9394          Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, "WinSetSysPointerData");
    9495        }
    95         xfree(buff, pszSrcFile, __LINE__);
     96        free(buff);
    9697      }
    9798      WinDismissDlg(hwnd, 1);
  • trunk/dll/shadow.c

    r1009 r1039  
    3030#include "strutil.h"                    // GetPString
    3131#include "fm3dll.h"
     32#include "fortify.h"
    3233
    3334#pragma data_seg(DATA1)
     
    5758              (path) ? ";STARTUPDIR=" : "", (path) ? path : "", objtitle);
    5859      WinSetObjectData(obj, s);
    59       xfree(s, pszSrcFile, __LINE__);
     60      free(s);
    6061    }
    6162  }
     
    158159                          objtitle,
    159160                          s, (location) ? location : cnr, CO_FAILIFEXISTS);
    160     xfree(s, pszSrcFile, __LINE__);
     161    free(s);
    161162  }
    162163  return obj;
  • trunk/dll/subj.c

    r1009 r1039  
    3232#include "strutil.h"                    // GetPString
    3333#include "fm3dll.h"
     34#include "fortify.h"
    3435
    3536static PSZ pszSrcFile = __FILE__;
     
    5758    pfealist = xmallocz(1024, pszSrcFile, __LINE__);
    5859    if (pfealist)
    59     xfree(pgealist, pszSrcFile, __LINE__);
     60    free(pgealist);
    6061    else {
    6162      pfealist->cbList = 1024;
     
    6566      rc = DosQueryPathInfo(filename, FIL_QUERYEASFROMLIST,
    6667                            (PVOID) & eaop, (ULONG) sizeof(EAOP2));
    67       xfree(pgealist, pszSrcFile, __LINE__);
     68      free(pgealist);
    6869      if (!rc) {
    6970        pfea = &eaop.fpFEA2List->list[0];
     
    7475        subject[1023] = 0;
    7576      }
    76       xfree(pfealist, pszSrcFile, __LINE__);
     77      free(pfealist);
    7778      if (rc == ERROR_SHARING_VIOLATION || rc == ERROR_ACCESS_DENIED) {
    7879        saymsg(MB_CANCEL,
  • trunk/dll/systemf.c

    r1021 r1039  
    4444#include "pathutil.h"
    4545#include "fm3dll.h"
     46#include "fortify.h"
    4647
    4748static PSZ pszSrcFile = __FILE__;
     
    599600                      EXEC_FRAME, &ex);
    600601      if (ret != 1) {
    601         xfree(commandline, pszSrcFile, __LINE__);
     602        free(commandline);
    602603        return (ret == 0) ? -1 : -2;
    603604      }
     
    609610                   (*ex.environment) ? ex.environment : NULL,
    610611                   "%s", commandline);
    611     xfree(commandline, pszSrcFile, __LINE__);
     612    free(commandline);
    612613    return ret;
    613614  }
     
    13051306              strcpy(executable, GetCmdSpec(FALSE));
    13061307            }
    1307             xfree(temp, pszSrcFile, __LINE__);
     1308            free(temp);
    13081309          }
    13091310        }
     
    13191320        pgd.swpInitial.hwndInsertBehind = HWND_TOP;
    13201321        happ = WinStartApp(hwndNotify, &pgd, NULL, NULL, ulOptions);
    1321         xfree(parameters, pszSrcFile, __LINE__);
     1322        free(parameters);
    13221323      }
    13231324    }
    1324     xfree(executable, pszSrcFile, __LINE__);
     1325    free(executable);
    13251326  }
    13261327  return happ;
  • trunk/dll/tools.c

    r1009 r1039  
    3535#include "strutil.h"                    // GetPString
    3636#include "fm3dll.h"
     37#include "fortify.h"
    3738
    3839#pragma data_seg(DATA1)
     
    5253  qtloaded = TRUE;
    5354  for (x = 0; x < 50 && quicktool[x]; x++) {
    54     xfree(quicktool[x], pszSrcFile, __LINE__);
     55    free(quicktool[x]);
    5556    quicktool[x] = NULL;
    5657  }
     
    268269        xfree(info->help, pszSrcFile, __LINE__);
    269270        xfree(info->text, pszSrcFile, __LINE__);
    270         xfree(info, pszSrcFile, __LINE__);
     271        free(info);
    271272        fToolsChanged = TRUE;
    272273        break;
     
    366367    xfree(tool->help, pszSrcFile, __LINE__);
    367368    xfree(tool->text, pszSrcFile, __LINE__);
    368     xfree(tool, pszSrcFile, __LINE__);
     369    free(tool);
    369370    tool = next;
    370371  }
  • trunk/dll/treecnr.c

    r1037 r1039  
    569569          fTopDir = temptop;
    570570      }
    571       xfree((CHAR *)mp1, pszSrcFile, __LINE__);
     571      free((CHAR *)mp1);
    572572    }
    573573    return 0;
     
    803803            Runtime_Error(pszSrcFile, __LINE__,
    804804                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    805             xfree(wk, pszSrcFile, __LINE__);
     805            free(wk);
    806806# ifdef FORTIFY
    807807  Fortify_LeaveScope();
     
    839839            Runtime_Error(pszSrcFile, __LINE__,
    840840                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    841             xfree(wk, pszSrcFile, __LINE__);
     841            free(wk);
    842842# ifdef FORTIFY
    843843  Fortify_LeaveScope();
     
    860860      WinSendMsg(dcd->hwndCnr,
    861861                 UM_CLOSE, MPFROMLONG(dcd->dontclose != FALSE), MPVOID);
    862       xfree(dcd, pszSrcFile, __LINE__);
     862      free(dcd);
    863863# ifdef FORTIFY
    864864  Fortify_LeaveScope();
     
    17351735      if (dir) {
    17361736        if (!PostMsg(dcd->hwndObject, UM_SHOWME, MPFROMP(dir), MPVOID))
    1737           xfree(dir, pszSrcFile, __LINE__);
     1737          free(dir);
    17381738      }
    17391739    }
     
    21792179        hwnd = StartMLEEditor(dcd->hwndParent,
    21802180                              (INT)mp1, (CHAR *)mp2, dcd->hwndFrame);
    2181       xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     2181      free((CHAR *)mp2);
    21822182      return MRFROMLONG(hwnd);
    21832183    }
     
    22482248          if (apptail == info)
    22492249            apptail = info->prev;
    2250           xfree(info, pszSrcFile, __LINE__);
     2250          free(info);
    22512251          break;
    22522252        }
     
    27712771            li->list = BuildList(hwnd);
    27722772            if (!li->list || !li->list[0]) {
    2773               xfree(li, pszSrcFile, __LINE__);
     2773              free(li);
    27742774# ifdef FORTIFY
    27752775  Fortify_LeaveScope();
     
    29422942      while (info) {
    29432943        next = info->next;
    2944         xfree(info, pszSrcFile, __LINE__);
     2944        free(info);
    29452945        info = next;
    29462946      }
     
    30833083                   IDS_WINCREATEWINDOW);
    30843084        PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    3085         xfree(dcd, pszSrcFile, __LINE__);
     3085        free(dcd);
    30863086# ifdef FORTIFY
    30873087  Fortify_LeaveScope();
  • trunk/dll/undel.c

    r1038 r1039  
    228228          Runtime_Error(pszSrcFile, __LINE__,
    229229                        GetPString(IDS_COULDNTSTARTTHREADTEXT));
    230           xfree(undelinfo, pszSrcFile, __LINE__);
     230          free(undelinfo);
    231231          listdone = TRUE;
    232232          WinDismissDlg(hwnd, 0);
  • trunk/dll/update.c

    r1017 r1039  
    3636#include "dircnrs.h"
    3737#include "fm3dll.h"
     38#include "fortify.h"
    3839
    3940static PSZ pszSrcFile = __FILE__;
     
    643644  PostMsg(hwndCnr, UM_RESCAN, MPVOID, MPVOID);
    644645  if (pciList) {
    645     xfree(pciList, pszSrcFile, __LINE__);
     646    free(pciList);
    646647    DosPostEventSem(CompactSem);
    647648  }
  • trunk/dll/viewer.c

    r1036 r1039  
    12571257          }
    12581258        }
    1259         xfree(vw, pszSrcFile, __LINE__);
     1259        free(vw);
    12601260      }
    12611261      if (!dontclose &&
  • trunk/dll/viewinf.c

    r1029 r1039  
    162162            p = strtok(NULL, ";");
    163163          }
    164           xfree(holdenv, pszSrcFile, __LINE__);
     164          free(holdenv);
    165165        NoEnv:
    166166          if (WinIsWindow(hab2, hwnd) && !repeating) {
     
    178178                  Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,
    179179                            "PrfQueryProfileData");
    180                   xfree(holdenv, pszSrcFile, __LINE__);
     180                  free(holdenv);
    181181                }
    182182                else
     
    193193    WinTerminate(hab2);
    194194  }
    195   xfree(dummy, pszSrcFile, __LINE__);
     195  free(dummy);
    196196# ifdef FORTIFY
    197197  Fortify_LeaveScope();
     
    274274          Runtime_Error(pszSrcFile, __LINE__,
    275275                        GetPString(IDS_COULDNTSTARTTHREADTEXT));
    276           xfree(d, pszSrcFile, __LINE__);
     276          free(d);
    277277          WinDismissDlg(hwnd, 0);
    278278          return 0;
  • trunk/dll/walkem.c

    r1034 r1039  
    4949#include "notebook.h"                   // targetdirectory
    5050#include "fm3dll.h"
     51#include "fortify.h"
    5152
    5253#pragma data_seg(DATA1)
     
    129130          pFirstSetup = pld->next;
    130131        xfree(pld->path, pszSrcFile, __LINE__);
    131         xfree(pld, pszSrcFile, __LINE__);
     132        free(pld);
    132133      }
    133134      return 1;                         // Found or added
     
    143144    pld->path = xstrdup(name, pszSrcFile, __LINE__);
    144145    if (!pld->path) {
    145       xfree(pld, pszSrcFile, __LINE__);
     146      free(pld);
    146147      return -1;
    147148    }
     
    195196  if (!PrfQueryProfileData(fmprof, FM3Str, pszLastSetups, pszBuf, &l)) {
    196197    Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, "PrfQueryProfileData");
    197     xfree(pszBuf, pszSrcFile, __LINE__);
     198    free(pszBuf);
    198199    return;
    199200  }
     
    201202  if (ulDataBytes != l) {
    202203    Runtime_Error(pszSrcFile, __LINE__, "PrfQueryProfileData reported %u expected %u", l, ulDataBytes);
    203     xfree(pszBuf, pszSrcFile, __LINE__);
     204    free(pszBuf);
    204205    return;
    205206  }
     
    214215    pld = xmalloc(sizeof(LINKDIRS), pszSrcFile, __LINE__);
    215216    if (!pld) {
    216       xfree(pszBuf, pszSrcFile, __LINE__);
     217      free(pszBuf);
    217218      return;
    218219    }
    219220    pld->path = xstrdup(psz, pszSrcFile, __LINE__);
    220221    if (!pld->path) {
    221       xfree(pszBuf, pszSrcFile, __LINE__);
    222       xfree(pld, pszSrcFile, __LINE__);
     222      free(pszBuf);
     223      free(pld);
    223224      return;
    224225    }
     
    235236  } // while
    236237
    237   xfree(pszBuf, pszSrcFile, __LINE__);
     238  free(pszBuf);
    238239
    239240  fSetupsLoaded = TRUE;
     
    338339          info->path = xstrdup(s, pszSrcFile, __LINE__);
    339340          if (!info->path)
    340             xfree(info, pszSrcFile, __LINE__);
     341            free(info);
    341342          else {
    342343            info->next = NULL;
     
    432433              ldirhead = info->next;
    433434            xfree(info->path, pszSrcFile, __LINE__);
    434             xfree(info, pszSrcFile, __LINE__);
     435            free(info);
    435436            break;
    436437          }
     
    444445        info->path = xstrdup(path, pszSrcFile, __LINE__);
    445446        if (!info->path)
    446           xfree(info, pszSrcFile, __LINE__);
     447          free(info);
    447448        else {
    448449          info->next = NULL;
     
    486487          udirhead = info->next;
    487488        xfree(info->path, pszSrcFile, __LINE__);
    488         xfree(info, pszSrcFile, __LINE__);
     489        free(info);
    489490        fUdirsChanged = TRUE;
    490491        return TRUE;
     
    503504          ldirhead = info->next;
    504505        xfree(info->path, pszSrcFile, __LINE__);
    505         xfree(info, pszSrcFile, __LINE__);
     506        free(info);
    506507        return TRUE;
    507508      }
     
    527528          ldirhead = info->next;
    528529        xfree(info->path, pszSrcFile, __LINE__);
    529         xfree(info, pszSrcFile, __LINE__);
     530        free(info);
    530531        return TRUE;
    531532      }
     
    545546    next = info->next;
    546547    xfree(info->path, pszSrcFile, __LINE__);
    547     xfree(info, pszSrcFile, __LINE__);
     548    free(info);
    548549    info = next;
    549550  }
     
    559560    next = info->next;
    560561    xfree(info->path, pszSrcFile, __LINE__);
    561     xfree(info, pszSrcFile, __LINE__);
     562    free(info);
    562563    info = next;
    563564  }
     
    12241225      if (wa->changed)
    12251226        WinSendMsg(hwnd, UM_SETUP3, MPVOID, MPVOID);
    1226       xfree(wa, pszSrcFile, __LINE__);
     1227      free(wa);
    12271228      WinDismissDlg(hwnd, 0);
    12281229      break;
  • trunk/dll/winlist.c

    r1009 r1039  
    2424#include "fm3dlg.h"
    2525#include "fm3dll.h"
     26#include "fortify.h"
    2627
    2728#pragma data_seg(DATA1)
     
    120121            y++;
    121122          }
    122           xfree(pswb, pszSrcFile, __LINE__);
     123          free(pswb);
    123124          DosPostEventSem(CompactSem);
    124125        }
  • trunk/dll/worker.c

    r1036 r1039  
    105105                            GetPString(IDS_COULDNTSTARTTHREADTEXT));
    106106              FreeListInfo(wk->li);
    107               xfree(wk, pszSrcFile, __LINE__);
     107              free(wk);
    108108# ifdef FORTIFY
    109109  Fortify_LeaveScope();
     
    270270                    if (!PostMsg(Collector,
    271271                                 UM_COLLECTFROMFILE, MPFROMP(temp), MPVOID))
    272                       xfree(temp, pszSrcFile, __LINE__);
     272                      free(temp);
    273273                  }
    274274                }
     
    978978    if (wk->li)
    979979      FreeListInfo(wk->li);
    980     xfree(wk, pszSrcFile, __LINE__);
     980    free(wk);
    981981# ifdef FORTIFY
    982982  Fortify_LeaveScope();
     
    11401140              for (x = 0; wk->li->list[x]; x++) {
    11411141                strcpy(p, wk->li->list[x]);
    1142                 xfree(wk->li->list[x], pszSrcFile, __LINE__);
     1142                free(wk->li->list[x]);
    11431143                wk->li->list[x] = xstrdup(szBuffer, pszSrcFile, __LINE__);
    11441144              }
     
    13201320                               UM_LOADFILE,
    13211321                               MPFROMLONG(5 + viewtype), MPFROMP(temp)))
    1322                     xfree(temp, pszSrcFile, __LINE__);
     1322                    free(temp);
    13231323                }
    13241324                DosSleep(1);
     
    13651365                               UM_LOADFILE,
    13661366                               MPFROMLONG(4 + viewtype), MPFROMP(temp)))
    1367                     xfree(temp, pszSrcFile, __LINE__);
     1367                    free(temp);
    13681368                }
    13691369                DosSleep(1);
     
    16431643    if (wk->li)
    16441644      FreeListInfo(wk->li);
    1645     xfree(wk, pszSrcFile, __LINE__);
     1645    free(wk);
    16461646# ifdef FORTIFY
    16471647  Fortify_LeaveScope();
  • trunk/eas.c

    r1011 r1039  
    7575    WinTerminate(hab);
    7676  }
    77   if (list)
    78     xfree(list, pszSrcFile, __LINE__);
     77  xfree(list, pszSrcFile, __LINE__);
    7978  return 0;
    8079}
Note: See TracChangeset for help on using the changeset viewer.