Changeset 959 for trunk/dll/command.c


Ignore:
Timestamp:
Feb 18, 2008, 1:47:31 AM (17 years ago)
Author:
Gregg Young
Message:

Use xfree where appropriate. Check that buffer exists following all xmallocs. Stopped at eas.c with xfree checking. One remaining xmalloc without test in dirsize.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/command.c

    r927 r959  
    305305  while (info) {
    306306    next = info->next;
    307     free(info->title);
    308     free(info->cl);
     307    xfree(info->title);
     308    xfree(info->cl);
    309309    free(info);
    310310    info = next;
     
    353353        info->flags = atol(flags);
    354354        if (!info->cl || !info->title) {
    355           if (info->cl)
    356             free(info->cl);
    357           if (info->title)
    358             free(info->title);
     355          xfree(info->cl);
     356          xfree(info->title);
    359357          free(info);
    360358          break;
     
    459457            cmdtail = info->prev;
    460458        }
    461         free(info->cl);
    462         free(info->title);
     459        xfree(info->cl);
     460        xfree(info->title);
    463461        free(info);
    464462        return TRUE;
     
    625623
    626624        pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     625        if (!pszWorkBuf)
     626          break; //already complained
    627627        memset(&temp, 0, sizeof(COMMAND));
    628628        WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl);
     
    721721
    722722        pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     723        if (!pszWorkBuf)
     724          break; //already complained
    723725        memset(&temp, 0, sizeof(COMMAND));
    724726        WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl);
     
    823825
    824826        pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     827        if (!pszWorkBuf)
     828          break; //already complained
    825829        memset(&temp, 0, sizeof(COMMAND));
    826830        WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl);
Note: See TracChangeset for help on using the changeset viewer.