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
lizhongxiao
OpenXG-RAN
Commits
b564b116
Commit
b564b116
authored
Sep 20, 2018
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory leaks in PROTO_AGENT
parent
7f40bf76
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
36 deletions
+38
-36
openair2/LAYER2/PROTO_AGENT/proto_agent.c
openair2/LAYER2/PROTO_AGENT/proto_agent.c
+26
-27
openair2/LAYER2/PROTO_AGENT/proto_agent.h
openair2/LAYER2/PROTO_AGENT/proto_agent.h
+1
-0
openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
+3
-3
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
+6
-2
openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
+2
-4
No files found.
openair2/LAYER2/PROTO_AGENT/proto_agent.c
View file @
b564b116
...
...
@@ -131,6 +131,11 @@ error:
}
void
proto_agent_stop
(
mod_id_t
mod_id
)
{
proto_agent_destroy_channel
(
proto_agent
[
mod_id
].
channel
->
channel_id
);
}
//void
//proto_agent_send_hello(void)
//{
...
...
@@ -164,24 +169,21 @@ proto_agent_send_rlc_data_req(const protocol_ctxt_t* const ctxt_pP,
int
msg_flag
=
0
;
int
msgsize
=
0
;
mod_id_t
mod_id
=
ctxt_pP
->
module_id
;
data_req_args
args
;
DevAssert
(
proto_agent
[
mod_id
].
channel
);
DevAssert
(
proto_agent
[
mod_id
].
channel
->
channel_info
);
data_req_args
*
args
=
malloc
(
sizeof
(
data_req_args
));
args
.
ctxt
=
ctxt_pP
;
args
.
srb_flag
=
srb_flagP
;
args
.
MBMS_flag
=
MBMS_flagP
;
args
.
rb_id
=
rb_idP
;
args
.
mui
=
muiP
;
args
.
confirm
=
confirmP
;
args
.
sdu_size
=
sdu_sizeP
;
args
.
sdu_p
=
sdu_pP
;
args
->
ctxt
=
malloc
(
sizeof
(
protocol_ctxt_t
));
memcpy
(
args
->
ctxt
,
ctxt_pP
,
sizeof
(
protocol_ctxt_t
));
args
->
srb_flag
=
srb_flagP
;
args
->
MBMS_flag
=
MBMS_flagP
;
args
->
rb_id
=
rb_idP
;
args
->
mui
=
muiP
;
args
->
confirm
=
confirmP
;
args
->
sdu_size
=
sdu_sizeP
;
args
->
sdu_p
=
malloc
(
sdu_sizeP
);
memcpy
(
args
->
sdu_p
,
sdu_pP
->
data
,
sdu_sizeP
);
msg_flag
=
proto_agent_pdcp_data_req
(
mod_id
,
(
void
*
)
args
,
&
init_msg
);
msg_flag
=
proto_agent_pdcp_data_req
(
mod_id
,
(
void
*
)
&
args
,
&
init_msg
);
if
(
msg_flag
!=
0
||
!
init_msg
)
goto
error
;
msg
=
proto_agent_pack_message
(
init_msg
,
&
msgsize
);
...
...
@@ -206,22 +208,19 @@ proto_agent_send_pdcp_data_ind(const protocol_ctxt_t* const ctxt_pP, const srb_f
int
msg_flag
=
0
;
int
msgsize
=
0
;
mod_id_t
mod_id
=
ctxt_pP
->
module_id
;
data_req_args
args
;
DevAssert
(
proto_agent
[
mod_id
].
channel
);
DevAssert
(
proto_agent
[
mod_id
].
channel
->
channel_info
);
data_req_args
*
args
=
malloc
(
sizeof
(
data_req_args
));
args
->
ctxt
=
malloc
(
sizeof
(
protocol_ctxt_t
));
memcpy
(
args
->
ctxt
,
ctxt_pP
,
sizeof
(
protocol_ctxt_t
));
args
->
srb_flag
=
srb_flagP
;
args
->
MBMS_flag
=
MBMS_flagP
;
args
->
rb_id
=
rb_idP
;
args
->
sdu_size
=
sdu_sizeP
;
args
->
sdu_p
=
malloc
(
sdu_sizeP
);
memcpy
(
args
->
sdu_p
,
sdu_pP
->
data
,
sdu_sizeP
);
args
.
ctxt
=
ctxt_pP
;
args
.
srb_flag
=
srb_flagP
;
args
.
MBMS_flag
=
MBMS_flagP
;
args
.
rb_id
=
rb_idP
;
args
.
sdu_size
=
sdu_sizeP
;
args
.
sdu_p
=
sdu_pP
;
msg_flag
=
proto_agent_pdcp_data_ind
(
mod_id
,
(
void
*
)
args
,
&
init_msg
);
msg_flag
=
proto_agent_pdcp_data_ind
(
mod_id
,
(
void
*
)
&
args
,
&
init_msg
);
if
(
msg_flag
!=
0
||
!
init_msg
)
goto
error
;
msg
=
proto_agent_pack_message
(
init_msg
,
&
msgsize
);
...
...
@@ -232,7 +231,7 @@ proto_agent_send_pdcp_data_ind(const protocol_ctxt_t* const ctxt_pP, const srb_f
return
;
error:
LOG_E
(
PROTO_AGENT
,
"there was an error
\n
"
);
LOG_E
(
PROTO_AGENT
,
"there was an error
in %s
\n
"
,
__func__
);
return
;
}
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent.h
View file @
b564b116
...
...
@@ -46,6 +46,7 @@
void
*
proto_agent_receive
(
void
*
args
);
int
proto_agent_start
(
mod_id_t
mod_id
,
const
cudu_params_t
*
p
);
void
proto_agent_stop
(
mod_id_t
mod_id
);
void
proto_agent_send_rlc_data_req
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
srb_flag_t
srb_flagP
,
const
MBMS_flag_t
MBMS_flagP
,
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
View file @
b564b116
...
...
@@ -68,7 +68,8 @@ proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bi
return
channel
;
error:
LOG_E
(
PROTO_AGENT
,
"there was an error
\n
"
);
if
(
channel
)
free
(
channel
);
fprintf
(
stderr
,
"error creating proto_agent_async_channel_t
\n
"
);
return
NULL
;
}
...
...
@@ -87,8 +88,7 @@ int proto_agent_async_msg_recv(void **data, int *size, int *priority, void *chan
void
proto_agent_async_release
(
proto_agent_channel_t
*
channel
)
{
proto_agent_async_channel_t
*
channel_info
;
channel_info
=
(
proto_agent_async_channel_t
*
)
channel
->
channel_info
;
proto_agent_async_channel_t
*
channel_info
=
channel
->
channel_info
;
destroy_link_manager
(
channel_info
->
manager
);
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
View file @
b564b116
...
...
@@ -453,8 +453,12 @@ int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg)
if
(
msg
->
msg_case
!=
PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG
)
goto
error
;
free
(
msg
->
data_req_ack
->
header
);
free
(
msg
->
data_req_ack
);
free
(
msg
->
data_ind_msg
->
header
);
free
(
msg
->
data_ind_msg
->
rlc_data
->
fsp_pdu
->
fsp_pdu_data
.
data
);
free
(
msg
->
data_ind_msg
->
rlc_data
->
fsp_pdu
);
free
(
msg
->
data_ind_msg
->
rlc_data
->
fsp_ctxt
);
free
(
msg
->
data_ind_msg
->
rlc_data
);
free
(
msg
->
data_ind_msg
);
free
(
msg
);
return
0
;
...
...
openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
View file @
b564b116
...
...
@@ -104,10 +104,8 @@ Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id,
LOG_I
(
PROTO_AGENT
,
"decoded_message case : %d, direction : %d
\n
"
,
decoded_message
->
msg_case
-
1
,
decoded_message
->
msg_dir
-
1
);
goto
error
;
}
else
if
(
err_code
==
1
)
{
protocol__flexsplit_message__free_unpacked
(
decoded_message
,
NULL
);
}
LOG_D
(
PROTO_AGENT
,
"Returning REPLY message after the callback
\n
"
);
return
reply_message
;
...
...
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