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
883aef17
Commit
883aef17
authored
Aug 26, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: xmalloc shouldn't initialize to zero, do that explicitly where needed.
parent
80a9a065
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
9 deletions
+11
-9
parser.y
tools/widl/parser.y
+2
-0
typelib.c
tools/widl/typelib.c
+4
-0
utils.c
tools/widl/utils.c
+3
-8
widltypes.h
tools/widl/widltypes.h
+1
-1
write_msft.c
tools/widl/write_msft.c
+1
-0
No files found.
tools/widl/parser.y
View file @
883aef17
...
...
@@ -1144,6 +1144,7 @@ static type_t *make_type(unsigned char type, type_t *ref)
t->sign = 0;
t->defined = FALSE;
t->written = FALSE;
t->user_types_registered = FALSE;
t->typelib_idx = -1;
INIT_LINK(t);
return t;
...
...
@@ -1203,6 +1204,7 @@ static var_t *make_var(char *name)
v->name = name;
v->ptr_level = 0;
v->type = NULL;
v->args = NULL;
v->tname = NULL;
v->attrs = NULL;
v->array = NULL;
...
...
tools/widl/typelib.c
View file @
883aef17
...
...
@@ -220,6 +220,8 @@ void start_typelib(char *name, attr_t *attrs)
typelib
->
name
=
xstrdup
(
name
);
typelib
->
filename
=
xstrdup
(
typelib_name
);
typelib
->
attrs
=
attrs
;
typelib
->
entry
=
NULL
;
typelib
->
importlibs
=
NULL
;
}
void
end_typelib
(
void
)
...
...
@@ -373,6 +375,7 @@ static void read_msft_importlib(importlib_t *importlib, int fd)
importlib
->
importinfos
[
i
].
flags
|=
MSFT_IMPINFO_OFFSET_IS_GUID
;
msft_read_guid
(
fd
,
&
segdir
,
base
.
posguid
,
&
importlib
->
importinfos
[
i
].
guid
);
}
else
memset
(
&
importlib
->
importinfos
[
i
].
guid
,
0
,
sizeof
(
importlib
->
importinfos
[
i
].
guid
));
tlb_lseek
(
fd
,
segdir
.
pNametab
.
offset
+
base
.
NameOffset
);
tlb_read
(
fd
,
&
nameintro
,
sizeof
(
nameintro
));
...
...
@@ -431,6 +434,7 @@ void add_importlib(const char *name)
chat
(
"add_importlib: %s
\n
"
,
name
);
importlib
=
xmalloc
(
sizeof
(
*
importlib
));
memset
(
importlib
,
0
,
sizeof
(
*
importlib
)
);
importlib
->
name
=
xstrdup
(
name
);
read_importlib
(
importlib
);
...
...
tools/widl/utils.c
View file @
883aef17
...
...
@@ -145,7 +145,7 @@ char *dup_basename(const char *name, const char *ext)
namelen
=
strlen
(
name
);
/* +4 for later extension and +1 for '\0' */
base
=
(
char
*
)
xmalloc
(
namelen
+
4
+
1
);
base
=
xmalloc
(
namelen
+
4
+
1
);
strcpy
(
base
,
name
);
if
(
!
strcasecmp
(
name
+
namelen
-
extlen
,
ext
))
{
...
...
@@ -164,12 +164,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
;
}
...
...
@@ -192,6 +187,6 @@ char *xstrdup(const char *str)
char
*
s
;
assert
(
str
!=
NULL
);
s
=
(
char
*
)
xmalloc
(
strlen
(
str
)
+
1
);
s
=
xmalloc
(
strlen
(
str
)
+
1
);
return
strcpy
(
s
,
str
);
}
tools/widl/widltypes.h
View file @
883aef17
...
...
@@ -49,7 +49,7 @@ typedef struct _typelib_t typelib_t;
type *l_next; \
type *l_prev
#define LINK(x,y) do { x->l_next = y; if (y) y->l_prev = x; } while (0)
#define LINK(x,y) do { x->l_next = y;
x->l_prev = NULL;
if (y) y->l_prev = x; } while (0)
#define INIT_LINK(x) do { x->l_next = NULL; x->l_prev = NULL; } while (0)
#define NEXT_LINK(x) ((x)->l_next)
...
...
tools/widl/write_msft.c
View file @
883aef17
...
...
@@ -1734,6 +1734,7 @@ static msft_typeinfo_t *create_msft_typeinfo(msft_typelib_t *typelib, enum type_
chat
(
"create_msft_typeinfo: name %s kind %d
\n
"
,
name
,
kind
);
msft_typeinfo
=
xmalloc
(
sizeof
(
*
msft_typeinfo
));
memset
(
msft_typeinfo
,
0
,
sizeof
(
*
msft_typeinfo
)
);
msft_typeinfo
->
typelib
=
typelib
;
...
...
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