Changeset 1032
- Timestamp:
- Jun 30, 2008, 4:55:36 AM (17 years ago)
- Location:
- trunk/dll
- Files:
-
- 13 edited
-
arccnrs.c (modified) (3 diffs)
-
autoview.c (modified) (2 diffs)
-
comp.c (modified) (11 diffs)
-
dircnrs.c (modified) (1 diff)
-
draglist.c (modified) (1 diff)
-
filldir.c (modified) (4 diffs)
-
fm3dll.h (modified) (1 diff)
-
grep.c (modified) (3 diffs)
-
mainwnd.c (modified) (1 diff)
-
makelist.c (modified) (2 diffs)
-
newview.c (modified) (1 diff)
-
objwin.c (modified) (3 diffs)
-
wrappers.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r1018 r1032 337 337 psz = pai->pszFileName; 338 338 pai->pszFileName = NullStr; 339 # ifdef FORTIFY 340 xfree(psz, pszSrcFile, __LINE__); 341 # else 339 342 free(psz); 343 # endif 344 # ifdef FORTIFY 345 Fortify_LeaveScope(); 346 # endif 340 347 } 341 348 } … … 1806 1813 li->list[x] = temp; 1807 1814 else { 1808 free(temp);1815 xfree(temp, pszSrcFile, __LINE__); 1809 1816 } 1810 1817 } … … 1816 1823 li->list[x] = temp; 1817 1824 else 1818 free(temp);1825 xfree(temp, pszSrcFile, __LINE__); 1819 1826 } 1820 1827 if (li->type == IDM_VIEW || li->type == IDM_EDIT) { -
trunk/dll/autoview.c
r1029 r1032 668 668 } 669 669 else { 670 # ifdef FORTIFY 671 Fortify_EnterScope(); 672 # endif 670 673 WinSetWindowULong(hwndAutoObj, QWL_USER, hwndParent); 671 674 priority_normal(); … … 677 680 WinDestroyMsgQueue(hmq2); 678 681 } 679 else 680 WinTerminate(hab2); 682 // else 683 WinTerminate(hab2); 684 # ifdef FORTIFY 685 xFortify_LeaveScope(pszSrcFile, __LINE__); 686 # endif 681 687 } 682 688 } -
trunk/dll/comp.c
r1029 r1032 203 203 hmq2 = WinCreateMsgQueue(hab2, 0); 204 204 if (hmq2) { 205 # ifdef FORTIFY 206 Fortify_EnterScope(); 207 # endif 205 208 WinCancelShutdown(hmq2, TRUE); 206 209 IncrThreadUsage(); … … 312 315 } 313 316 WinTerminate(hab2); 317 # ifdef FORTIFY 318 xFortify_LeaveScope(pszSrcFile, __LINE__); 319 # endif 314 320 } 315 321 } … … 404 410 hmq = WinCreateMsgQueue(hab, 0); 405 411 if (hmq) { 412 # ifdef FORTIFY 413 Fortify_EnterScope(); 414 # endif 406 415 WinCancelShutdown(hmq, TRUE); 407 416 IncrThreadUsage(); … … 682 691 // PostMsg(cmp->hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DESELECTALL, 0), MPVOID); // 18 Jan 08 SHL we can count now 683 692 DecrThreadUsage(); 693 xfree(cmp, pszSrcFile, __LINE__); 684 694 WinTerminate(hab); 695 # ifdef FORTIFY 696 xFortify_LeaveScope(pszSrcFile, __LINE__); 697 # endif 685 698 } 686 xfree(cmp, pszSrcFile, __LINE__); 699 else 700 xfree(cmp, pszSrcFile, __LINE__); 687 701 } 688 702 … … 708 722 hmq = WinCreateMsgQueue(hab, 0); 709 723 if (hmq) { 724 # ifdef FORTIFY 725 Fortify_EnterScope(); 726 # endif 710 727 WinCancelShutdown(hmq, TRUE); 711 728 IncrThreadUsage(); … … 739 756 } 740 757 DecrThreadUsage(); 758 xfree(cmp, pszSrcFile, __LINE__); 741 759 WinTerminate(hab); 760 # ifdef FORTIFY 761 xFortify_LeaveScope(pszSrcFile, __LINE__); 762 # endif 742 763 } 743 xfree(cmp, pszSrcFile, __LINE__); 764 else 765 xfree(cmp, pszSrcFile, __LINE__); 744 766 } 745 767 … … 1932 1954 } // if on both sides 1933 1955 1934 if (x <= 0) 1956 if (x <= 0) { 1957 # ifdef FORTIFY 1958 xfree(filesl[l++], pszSrcFile, __LINE__); 1959 # else 1935 1960 free(filesl[l++]); // Done with item on left 1936 1937 if (x >= 0) 1938 free(filesr[r++]); // Done with item on right 1939 1961 # endif 1962 } 1963 if (x >= 0) { 1964 # ifdef FORTIFY 1965 xfree(filesr[r++], pszSrcFile, __LINE__); 1966 # else 1967 free(filesr[r++]); // Done with item on right 1968 #endif 1969 } 1940 1970 // Ensure empty buffers point somewhere 1941 1971 if (!pcil->pszFileName) { … … 1956 1986 1957 1987 if (!pcil->pszSubject) 1958 pcil->pszSubject = NullStr;1959 1988 if (!pcir->pszSubject) 1960 1989 pcir->pszSubject = NullStr; … … 1987 2016 } 1988 2017 if (filesl) { 1989 for(; filesl[l]; l++) 1990 free(filesl[l]); 2018 for(; filesl[l]; l++) { 2019 # ifdef FORTIFY 2020 xfree(filesl[l], pszSrcFile, __LINE__); 2021 # else 2022 free(filesl[l]); 2023 # endif 2024 } 1991 2025 } 1992 2026 if (pcir) { … … 1998 2032 } 1999 2033 if (filesr) { 2000 for (; filesr[r]; r++) 2001 free(filesr[r]); 2034 for (; filesr[r]; r++) { 2035 # ifdef FORTIFY 2036 xfree(filesr[r], pszSrcFile, __LINE__); 2037 # else 2038 free(filesr[r]); 2039 # endif 2040 } 2002 2041 } 2003 2042 // Reduce count to match what is in containers … … 2078 2117 2079 2118 # ifdef FORTIFY 2080 // 10 May 08 SHL fixme to suppress W111 2081 Fortify_LeaveScope(); 2119 xFortify_LeaveScope(pszSrcFile, __LINE__); 2082 2120 # endif 2083 2121 -
trunk/dll/dircnrs.c
r1029 r1032 3361 3361 xfree(dcd, pszSrcFile, __LINE__); 3362 3362 # ifdef FORTIFY 3363 free_commands(); 3364 free_associations(); 3365 free_udir(); 3366 free_ldir(); 3367 free_archivers(); 3368 Fortify_LeaveScope(); 3363 xFortify_LeaveScope(pszSrcFile, __LINE__); 3369 3364 # endif 3370 3365 WinSetWindowPtr(hwnd, QWL_USER, NULL); -
trunk/dll/draglist.c
r1011 r1032 714 714 "DrgSetDragitem"); 715 715 } 716 free(ppDItem[ulSelect]);716 xfree(ppDItem[ulSelect], pszSrcFile, __LINE__); 717 717 } // for 718 718 #ifdef __DEBUG_ALLOC__ -
trunk/dll/filldir.c
r1018 r1032 1585 1585 psz = pci->pszSubject; 1586 1586 pci->pszSubject = NullStr; 1587 # ifdef FORTIFY 1588 xfree(psz, pszSrcFile, __LINE__); 1589 # else 1587 1590 free(psz); 1591 # endif 1588 1592 } 1589 1593 … … 1596 1600 psz = pci->pszLongName; 1597 1601 pci->pszLongName = NullStr; 1602 # ifdef FORTIFY 1603 xfree(psz, pszSrcFile, __LINE__); 1604 # else 1598 1605 free(psz); 1606 # endif 1599 1607 } 1600 1608 … … 1602 1610 psz = pci->pszFileName; 1603 1611 pci->pszFileName = NullStr; 1612 # ifdef FORTIFY 1613 xfree(psz, pszSrcFile, __LINE__); 1614 # else 1604 1615 free(psz); 1616 # endif 1605 1617 } 1606 1618 … … 1608 1620 psz = pci->pszFmtFileSize; 1609 1621 pci->pszFmtFileSize = NullStr; 1622 # ifdef FORTIFY 1623 xfree(psz, pszSrcFile, __LINE__); 1624 # else 1610 1625 free(psz); 1626 # endif 1611 1627 } 1612 1628 } -
trunk/dll/fm3dll.h
r1029 r1032 1085 1085 PVOID xrealloc(PVOID pvIn, size_t cBytes, PCSZ pszSrcFile, UINT uiLineNumber); 1086 1086 PVOID xstrdup(PCSZ pszIn, PCSZ pszSrcFile, UINT uiLineNumber); 1087 unsigned char xFortify_LeaveScope(PCSZ pszSrcFile, UINT uiLineNumber); 1087 1088 1088 1089 //===================================================================== -
trunk/dll/grep.c
r1029 r1032 411 411 if (grep.dupehead) 412 412 FreeDupes(&grep); 413 if (grep.numlines && grep.matched) 413 if (grep.numlines && grep.matched) { 414 # ifdef FORTIFY 415 xfree(grep.matched, pszSrcFile, __LINE__); 416 # else 414 417 free(grep.matched); 418 # endif 419 } 415 420 // 07 Feb 08 SHL fixme to free grep here when not static 416 421 # ifdef FORTIFY … … 657 662 if (grep) { 658 663 if (grep->insertffb) { 659 for (x = 0; grep->insertffb[x]; x++) 660 free(grep->insertffb[x]); 661 free(grep->insertffb); 664 for (x = 0; grep->insertffb[x]; x++) { 665 # ifdef FORTIFY 666 xfree(grep->insertffb[x], pszSrcFile, __LINE__); 667 # else 668 free(grep->insertffb[x]); 669 #endif 670 } 671 xfree(grep->insertffb, pszSrcFile, __LINE__); 662 672 } 663 673 if (grep->dir) { 664 for (x = 0; grep->dir[x]; x++) 665 free(grep->dir[x]); 666 free(grep->dir); 674 for (x = 0; grep->dir[x]; x++) { 675 # ifdef FORTIFY 676 xfree(grep->dir[x], pszSrcFile, __LINE__); 677 # else 678 free(grep->dir[x]); 679 # endif 680 } 681 xfree(grep->dir, pszSrcFile, __LINE__); 667 682 } 668 683 grep->dir = NULL; … … 1147 1162 while (i) { 1148 1163 next = i->next; 1149 if (i->name) 1164 if (i->name) { 1165 # ifdef FORTIFY 1166 xfree(i->name, pszSrcFile, __LINE__); 1167 # else 1150 1168 free(i->name); 1169 # endif 1170 } 1171 # ifdef FORTIFY 1172 xfree(i, pszSrcFile, __LINE__); 1173 # else 1151 1174 free(i); 1175 # endif 1152 1176 i = next; 1153 1177 } -
trunk/dll/mainwnd.c
r1031 r1032 6364 6364 WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID); 6365 6365 # ifdef FORTIFY 6366 free_commands(); 6367 free_associations(); 6368 free_udir(); 6369 free_ldir(); 6370 free_archivers(); 6371 Fortify_LeaveScope(); 6366 Fortify_LeaveScope( pszSrcFile, __LINE__); 6372 6367 # endif 6373 6368 break; -
trunk/dll/makelist.c
r1029 r1032 91 91 _heap_check(); 92 92 #endif 93 # ifdef FORTIFY 94 xfree(list[x], pszSrcFile, __LINE__); 95 # else 93 96 free(list[x]); 97 # endif 94 98 } 95 99 #ifdef __DEBUG_ALLOC__ … … 266 270 for (x = 0; list[x]; x++) { 267 271 if (item == list[x]) { 268 free(list[x]); 272 # ifdef FORTIFY 273 xfree(list[x], pszSrcFile, __LINE__); 274 # else 275 free(list[x]); 276 # endif 269 277 list[x] = NULL; 270 278 for (y = x;; y++) { -
trunk/dll/newview.c
r1029 r1032 650 650 DosPostEventSem(CompactSem); 651 651 # ifdef FORTIFY 652 Fortify_LeaveScope();652 xFortify_LeaveScope(pszSrcFile, __LINE__); 653 653 # endif 654 654 } -
trunk/dll/objwin.c
r907 r1032 25 25 #include "errutil.h" // Win_Error 26 26 #include "fm3dll.h" 27 #include "fortify.h" 27 28 28 29 static PSZ pszSrcFile = __FILE__; … … 75 76 IDS_WINCREATEWINDOW); 76 77 else { 78 # ifdef FORTIFY 79 Fortify_EnterScope(); 80 # endif 77 81 WinSetWindowPtr(ObjectHwnd, QWL_USER, args); 78 82 /* initially populate container */ … … 86 90 WinDestroyMsgQueue(hmq2); 87 91 } 92 # ifdef FORTIFY 93 xFortify_LeaveScope(pszSrcFile, __LINE__); 94 # endif 88 95 WinTerminate(hab2); 89 96 } -
trunk/dll/wrappers.c
r1011 r1032 32 32 #include "errutil.h" // Dos_Error... 33 33 #include "strutil.h" // GetPString 34 #include "command.h" 35 #include "tools.h" 36 #include "avl.h" 34 37 35 38 #include "fortify.h" // GetPString … … 403 406 } 404 407 405 #pragma alloc_text(WRAPPERS1,xfree,xfopen,xfsopen,xmalloc,xrealloc, xstrdup) 406 #pragma alloc_text(WRAPPERS2,xDosSetPathInfo,xDosFindFirst,xDosFindNext) 408 # ifdef FORTIFY 409 unsigned char xFortify_LeaveScope(PCSZ pszSrcFile, UINT uiLineNumber) 410 { 411 unsigned char ret; 412 413 free_commands(); 414 free_associations(); 415 free_udir(); 416 free_ldir(); 417 free_archivers(); 418 free_tools(); 419 ret = Fortify_LeaveScope(pszSrcFile, uiLineNumber); 420 load_commands(); 421 load_udirs(); 422 return ret; 423 } 424 # endif 425 426 #pragma alloc_text(WRAPPERS1,xfree,xfopen,xfsopen,xmalloc,xrealloc,xstrdup) 427 #pragma alloc_text(WRAPPERS2,xDosSetPathInfo,xDosFindFirst,xDosFindNext,xFortify_LeaveScope)
Note:
See TracChangeset
for help on using the changeset viewer.
