Changeset 959 for trunk/dll/avv.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/avv.c

    r931 r959  
    100100    PSZ pszWorkBuf;
    101101    pszWorkBuf = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    102     NormalizeCmdLine(pszWorkBuf, szCmdLine);
    103     pszDest = xstrdup(szCmdLine, pszSrcFile, __LINE__);
    104     xfree(pszWorkBuf);
     102    if (pszWorkBuf) {
     103      NormalizeCmdLine(pszWorkBuf, szCmdLine);
     104      pszDest = xstrdup(pszWorkBuf, pszSrcFile, __LINE__);
     105      xfree(pszWorkBuf);
     106    }
     107    else
     108      pszDest = xstrdup(szCmdLine, pszSrcFile, __LINE__); // return the unexamined input on failure
    105109  }
    106110  else
Note: See TracChangeset for help on using the changeset viewer.