Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1659f53c
Commit
1659f53c
authored
Aug 26, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmc: xmalloc shouldn't initialize to zero, do that explicitly where needed.
parent
883aef17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
mcy.y
tools/wmc/mcy.y
+7
-3
utils.c
tools/wmc/utils.c
+1
-6
No files found.
tools/wmc/mcy.y
View file @
1659f53c
...
...
@@ -389,7 +389,7 @@ lines : tLINE { $$ = $1; }
/*----------------------------------------------------------------------
* Helper rules
*/
token : tIDENT { $$ = xmalloc(sizeof(token_t)); $$->name = $1; }
token : tIDENT { $$ = xmalloc(sizeof(token_t));
memset($$,0,sizeof(*$$));
$$->name = $1; }
| tTOKEN { $$ = $1; }
;
...
...
@@ -451,7 +451,10 @@ static msg_t *add_lanmsg(msg_t *msg, lanmsg_t *lanmsg)
{
int i;
if(!msg)
{
msg = xmalloc(sizeof(msg_t));
memset( msg, 0, sizeof(*msg) );
}
msg->msgs = xrealloc(msg->msgs, (msg->nmsgs+1) * sizeof(*(msg->msgs)));
msg->msgs[msg->nmsgs] = lanmsg;
msg->nmsgs++;
...
...
@@ -489,7 +492,8 @@ static msg_t *complete_msg(msg_t *mp, int id)
static void add_node(node_e type, void *p)
{
node_t *ndp = (node_t *)xmalloc(sizeof(node_t));
node_t *ndp = xmalloc(sizeof(node_t));
memset( ndp, 0, sizeof(*ndp) );
ndp->type = type;
ndp->u.all = p;
...
...
@@ -601,7 +605,7 @@ static lan_blk_t *block_messages(node_t *head)
for(nl = 0; nl < msgtab[0]->nmsgs; nl++) /* This should be equal for all after check_languages() */
{
lbp = xmalloc(sizeof(lan_blk_t));
memset( lbp, 0, sizeof(*lbp) );
if(!lblktail)
{
lblkhead = lblktail = lbp;
...
...
tools/wmc/utils.c
View file @
1659f53c
...
...
@@ -148,12 +148,7 @@ void *xmalloc(size_t size)
{
error
(
"Virtual memory exhausted.
\n
"
);
}
/*
* We set it to 0.
* This is *paramount* because we depend on it
* just about everywhere in the rest of the code.
*/
memset
(
res
,
0
,
size
);
memset
(
res
,
0x55
,
size
);
return
res
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment