Skip to content

Commit

Permalink
Merge pull request #1931 from edigaryev/correct-xmalloc-usage
Browse files Browse the repository at this point in the history
Fix xMalloc usage
  • Loading branch information
masatake committed Nov 5, 2018
2 parents ed9b58d + 6952bef commit 0f27679
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion parsers/cxx/cxx_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void cxxTokenForceDestroy(CXXToken * t);

static CXXToken *createToken(void *createArg CTAGS_ATTR_UNUSED)
{
CXXToken *t = xMalloc(sizeof(CXXToken),CXXToken);
CXXToken *t = xMalloc(1, CXXToken);
// we almost always want a string, and since this token
// is being reused..well.. we always want it
t->pszWord = vStringNew();
Expand Down
2 changes: 1 addition & 1 deletion parsers/cxx/cxx_token_chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void cxxTokenChainInit(CXXTokenChain * tc)

CXXTokenChain * cxxTokenChainCreate(void)
{
CXXTokenChain * tc = xMalloc(sizeof(CXXTokenChain),CXXTokenChain);
CXXTokenChain * tc = xMalloc(1, CXXTokenChain);
cxxTokenChainInit(tc);
return tc;
}
Expand Down

0 comments on commit 0f27679

Please sign in to comment.