Changeset 1039 for trunk/dll/walkem.c


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;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.