Changeset 1032 for trunk/dll/comp.c


Ignore:
Timestamp:
Jun 30, 2008, 4:55:36 AM (17 years ago)
Author:
Gregg Young
Message:

Fortify updates including a leave scope wrapper which frees and in some cases reloads commands, archivers, association, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/comp.c

    r1029 r1032  
    203203      hmq2 = WinCreateMsgQueue(hab2, 0);
    204204      if (hmq2) {
     205# ifdef FORTIFY
     206  Fortify_EnterScope();
     207# endif
    205208        WinCancelShutdown(hmq2, TRUE);
    206209        IncrThreadUsage();
     
    312315      }
    313316      WinTerminate(hab2);
     317# ifdef FORTIFY
     318      xFortify_LeaveScope(pszSrcFile, __LINE__);
     319# endif
    314320    }
    315321  }
     
    404410    hmq = WinCreateMsgQueue(hab, 0);
    405411    if (hmq) {
     412# ifdef FORTIFY
     413  Fortify_EnterScope();
     414# endif
    406415      WinCancelShutdown(hmq, TRUE);
    407416      IncrThreadUsage();
     
    682691    // PostMsg(cmp->hwnd, WM_COMMAND, MPFROM2SHORT(IDM_DESELECTALL, 0), MPVOID);        // 18 Jan 08 SHL we can count now
    683692    DecrThreadUsage();
     693    xfree(cmp, pszSrcFile, __LINE__);
    684694    WinTerminate(hab);
     695# ifdef FORTIFY
     696    xFortify_LeaveScope(pszSrcFile, __LINE__);
     697# endif
    685698  }
    686   xfree(cmp, pszSrcFile, __LINE__);
     699  else
     700    xfree(cmp, pszSrcFile, __LINE__);
    687701}
    688702
     
    708722    hmq = WinCreateMsgQueue(hab, 0);
    709723    if (hmq) {
     724# ifdef FORTIFY
     725  Fortify_EnterScope();
     726# endif
    710727      WinCancelShutdown(hmq, TRUE);
    711728      IncrThreadUsage();
     
    739756    }
    740757    DecrThreadUsage();
     758    xfree(cmp, pszSrcFile, __LINE__);
    741759    WinTerminate(hab);
     760# ifdef FORTIFY
     761    xFortify_LeaveScope(pszSrcFile, __LINE__);
     762# endif
    742763  }
    743   xfree(cmp, pszSrcFile, __LINE__);
     764  else
     765    xfree(cmp, pszSrcFile, __LINE__);
    744766}
    745767
     
    19321954          } // if on both sides
    19331955
    1934           if (x <= 0)
     1956          if (x <= 0) {
     1957# ifdef FORTIFY
     1958            xfree(filesl[l++], pszSrcFile, __LINE__);
     1959# else
    19351960            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          }
    19401970          // Ensure empty buffers point somewhere
    19411971          if (!pcil->pszFileName) {
     
    19561986
    19571987          if (!pcil->pszSubject)
    1958             pcil->pszSubject = NullStr;
    19591988          if (!pcir->pszSubject)
    19601989            pcir->pszSubject = NullStr;
     
    19872016          }
    19882017          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            }
    19912025          }
    19922026          if (pcir) {
     
    19982032          }
    19992033          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            }
    20022041          }
    20032042          // Reduce count to match what is in containers
     
    20782117
    20792118# ifdef FORTIFY
    2080   // 10 May 08 SHL fixme to suppress W111
    2081   Fortify_LeaveScope();
     2119  xFortify_LeaveScope(pszSrcFile, __LINE__);
    20822120# endif
    20832121
Note: See TracChangeset for help on using the changeset viewer.