Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
414d3794
Commit
414d3794
authored
Feb 27, 2021
by
Michael Cook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netlink_init.c: Memory leak
Found by `-fsanitize=address`.
parent
2520d111
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
0 deletions
+12
-0
openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
+8
-0
openair1/SIMULATION/ETH_TRANSPORT/proto.h
openair1/SIMULATION/ETH_TRANSPORT/proto.h
+1
-0
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+1
-0
targets/RT/USER/lte-softmodem.c
targets/RT/USER/lte-softmodem.c
+1
-0
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+1
-0
No files found.
openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
View file @
414d3794
...
@@ -133,6 +133,7 @@ int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ...,
...
@@ -133,6 +133,7 @@ int netlink_init_mbms_tun(char *ifprefix, int id) {//for UE, id = 1, 2, ...,
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
// TX PART
// TX PART
free
(
nas_nlh_tx
);
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
/* Fill the netlink message header */
/* Fill the netlink message header */
...
@@ -193,6 +194,7 @@ int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, .
...
@@ -193,6 +194,7 @@ int netlink_init_tun(char *ifprefix, int num_if, int id) {//for UE, id = 1, 2, .
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
// TX PART
// TX PART
free
(
nas_nlh_tx
);
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
/* Fill the netlink message header */
/* Fill the netlink message header */
...
@@ -251,6 +253,7 @@ int netlink_init(void) {
...
@@ -251,6 +253,7 @@ int netlink_init(void) {
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_pid
=
0
;
/* For Linux Kernel */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
nas_dest_addr
.
nl_groups
=
0
;
/* unicast */
// TX PART
// TX PART
free
(
nas_nlh_tx
);
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
nas_nlh_tx
=
(
struct
nlmsghdr
*
)
malloc
(
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
memset
(
nas_nlh_tx
,
0
,
NLMSG_SPACE
(
NL_MAX_PAYLOAD
));
/* Fill the netlink message header */
/* Fill the netlink message header */
...
@@ -273,3 +276,8 @@ int netlink_init(void) {
...
@@ -273,3 +276,8 @@ int netlink_init(void) {
return
(
nas_sock_fd
[
0
]);
return
(
nas_sock_fd
[
0
]);
}
}
void
netlink_cleanup
(
void
)
{
free
(
nas_nlh_tx
);
nas_nlh_tx
=
NULL
;
}
openair1/SIMULATION/ETH_TRANSPORT/proto.h
View file @
414d3794
...
@@ -64,5 +64,6 @@ void clear_UE_transport_info(uint8_t);
...
@@ -64,5 +64,6 @@ void clear_UE_transport_info(uint8_t);
int
netlink_init
(
void
);
int
netlink_init
(
void
);
int
netlink_init_tun
(
char
*
ifsuffix
,
int
num_if
,
int
id
);
int
netlink_init_tun
(
char
*
ifsuffix
,
int
num_if
,
int
id
);
int
netlink_init_mbms_tun
(
char
*
ifsuffix
,
int
id
);
int
netlink_init_mbms_tun
(
char
*
ifsuffix
,
int
id
);
void
netlink_cleanup
(
void
);
#endif
/* EMU_PROTO_H_ */
#endif
/* EMU_PROTO_H_ */
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
View file @
414d3794
...
@@ -2331,6 +2331,7 @@ pdcp_free (
...
@@ -2331,6 +2331,7 @@ pdcp_free (
void
pdcp_module_cleanup
(
void
)
void
pdcp_module_cleanup
(
void
)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
{
{
netlink_cleanup
();
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
targets/RT/USER/lte-softmodem.c
View file @
414d3794
...
@@ -803,6 +803,7 @@ int main ( int argc, char **argv )
...
@@ -803,6 +803,7 @@ int main ( int argc, char **argv )
}
}
}
}
pdcp_module_cleanup
();
terminate_opt
();
terminate_opt
();
logClean
();
logClean
();
printf
(
"Bye.
\n
"
);
printf
(
"Bye.
\n
"
);
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
414d3794
...
@@ -834,6 +834,7 @@ int main( int argc, char **argv ) {
...
@@ -834,6 +834,7 @@ int main( int argc, char **argv ) {
if
(
PHY_vars_UE_g
[
0
][
0
]
->
rfdevice
.
trx_end_func
)
if
(
PHY_vars_UE_g
[
0
][
0
]
->
rfdevice
.
trx_end_func
)
PHY_vars_UE_g
[
0
][
0
]
->
rfdevice
.
trx_end_func
(
&
PHY_vars_UE_g
[
0
][
0
]
->
rfdevice
);
PHY_vars_UE_g
[
0
][
0
]
->
rfdevice
.
trx_end_func
(
&
PHY_vars_UE_g
[
0
][
0
]
->
rfdevice
);
pdcp_module_cleanup
();
terminate_opt
();
terminate_opt
();
logClean
();
logClean
();
printf
(
"Bye.
\n
"
);
printf
(
"Bye.
\n
"
);
...
...
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