Commit ba81c62e authored by Dong Anyuan's avatar Dong Anyuan

Fix Coverity Scan CID 300496 (Variable header going out of scope leaks the storage it points to.)

parent f4def402
...@@ -1075,6 +1075,7 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess ...@@ -1075,6 +1075,7 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess
Protocol__FlexDlMacConfig *dl_mac_config_msg; Protocol__FlexDlMacConfig *dl_mac_config_msg;
dl_mac_config_msg = malloc(sizeof(Protocol__FlexDlMacConfig)); dl_mac_config_msg = malloc(sizeof(Protocol__FlexDlMacConfig));
if (dl_mac_config_msg == NULL) { if (dl_mac_config_msg == NULL) {
free(header);
goto error; goto error;
} }
protocol__flex_dl_mac_config__init(dl_mac_config_msg); protocol__flex_dl_mac_config__init(dl_mac_config_msg);
...@@ -1084,8 +1085,10 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess ...@@ -1084,8 +1085,10 @@ int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMess
dl_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id); dl_mac_config_msg->sfn_sf = flexran_get_sfn_sf(mod_id);
*msg = malloc(sizeof(Protocol__FlexranMessage)); *msg = malloc(sizeof(Protocol__FlexranMessage));
if(*msg == NULL) if(*msg == NULL) {
free(header);
goto error; goto error;
}
protocol__flexran_message__init(*msg); protocol__flexran_message__init(*msg);
(*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG; (*msg)->msg_case = PROTOCOL__FLEXRAN_MESSAGE__MSG_DL_MAC_CONFIG_MSG;
(*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE; (*msg)->msg_dir = PROTOCOL__FLEXRAN_DIRECTION__INITIATING_MESSAGE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment