Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8494453a
Commit
8494453a
authored
Sep 19, 2010
by
Arnaud Lacombe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kconfig: use calloc() for expr allocation
Signed-off-by:
Arnaud Lacombe
<
lacombar@gmail.com
>
parent
1ea3ad4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
scripts/kconfig/expr.c
scripts/kconfig/expr.c
+4
-8
No files found.
scripts/kconfig/expr.c
View file @
8494453a
...
...
@@ -13,8 +13,7 @@
struct
expr
*
expr_alloc_symbol
(
struct
symbol
*
sym
)
{
struct
expr
*
e
=
malloc
(
sizeof
(
*
e
));
memset
(
e
,
0
,
sizeof
(
*
e
));
struct
expr
*
e
=
calloc
(
1
,
sizeof
(
*
e
));
e
->
type
=
E_SYMBOL
;
e
->
left
.
sym
=
sym
;
return
e
;
...
...
@@ -22,8 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym)
struct
expr
*
expr_alloc_one
(
enum
expr_type
type
,
struct
expr
*
ce
)
{
struct
expr
*
e
=
malloc
(
sizeof
(
*
e
));
memset
(
e
,
0
,
sizeof
(
*
e
));
struct
expr
*
e
=
calloc
(
1
,
sizeof
(
*
e
));
e
->
type
=
type
;
e
->
left
.
expr
=
ce
;
return
e
;
...
...
@@ -31,8 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
struct
expr
*
expr_alloc_two
(
enum
expr_type
type
,
struct
expr
*
e1
,
struct
expr
*
e2
)
{
struct
expr
*
e
=
malloc
(
sizeof
(
*
e
));
memset
(
e
,
0
,
sizeof
(
*
e
));
struct
expr
*
e
=
calloc
(
1
,
sizeof
(
*
e
));
e
->
type
=
type
;
e
->
left
.
expr
=
e1
;
e
->
right
.
expr
=
e2
;
...
...
@@ -41,8 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e
struct
expr
*
expr_alloc_comp
(
enum
expr_type
type
,
struct
symbol
*
s1
,
struct
symbol
*
s2
)
{
struct
expr
*
e
=
malloc
(
sizeof
(
*
e
));
memset
(
e
,
0
,
sizeof
(
*
e
));
struct
expr
*
e
=
calloc
(
1
,
sizeof
(
*
e
));
e
->
type
=
type
;
e
->
left
.
sym
=
s1
;
e
->
right
.
sym
=
s2
;
...
...
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