Changeset 959 for trunk/dll/assoc.c


Ignore:
Timestamp:
Feb 18, 2008, 1:47:31 AM (18 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/assoc.c

    r927 r959  
    117117  while (info) {
    118118    next = info->next;
    119     free(info->mask);
    120     free(info->cl);
    121     if (info->sig)
    122       free(info->sig);
    123     free(info);
     119    xfree(info->mask);
     120    xfree(info->cl);
     121    xfree(info->sig);
     122    xfree(info);
    124123    info = next;
    125124  }
     
    177176        info->flags = atol(flags);
    178177        if (!info->cl || !info->mask) {
    179           if (info->cl)
    180             free(info->cl);
    181           if (info->mask)
    182             free(info->mask);
    183           free(info);
     178          xfree(info->cl);
     179          xfree(info->mask);
     180          xfree(info);
    184181          break;
    185182        }
     
    272269          info->flags = addme->flags;
    273270        if (!info->cl || !info->mask) {
    274           if (info->cl)
    275             free(info->cl);
    276           if (info->mask)
    277             free(info->mask);
    278           free(info);
     271          xfree(info->cl);
     272          xfree(info->mask);
     273          xfree(info);
    279274        }
    280275        else {
     
    320315            asstail = info->prev;
    321316        }
    322         free(info->cl);
    323         free(info->mask);
    324         if (info->sig)
    325           free(info->sig);
    326         free(info);
     317        xfree(info->cl);
     318        xfree(info->mask);
     319        xfree(info->sig);
     320        xfree(info);
    327321        return TRUE;
    328322      }
     
    646640        }
    647641        pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     642        if (!pszWorkBuf)
     643          break; //already complained
    648644        memset(&temp, 0, sizeof(ASSOC));
    649645        WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask);
     
    735731
    736732        pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     733        if (!pszWorkBuf)
     734          break; //already complained
    737735        memset(&temp, 0, sizeof(ASSOC));
    738736        WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask);
     
    850848                                      MPFROMSHORT(LIT_CURSOR), MPVOID);
    851849        pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
     850        if (!pszWorkBuf)
     851          break; //already complained
    852852        memset(&temp, 0, sizeof(ASSOC));
    853853        WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask);
Note: See TracChangeset for help on using the changeset viewer.