Commit a7bce4ab authored by wujing's avatar wujing

fix assertfatal cause by ue_type!=NOCE

parent 236c416f
...@@ -81,13 +81,22 @@ void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config) ...@@ -81,13 +81,22 @@ void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config)
if(size == 0) if(size == 0)
return 0; return 0;
void* buffer_p = NULL;
if(config && config->allocate) if(config && config->allocate)
{ {
return (config->allocate)(size); buffer_p = (config->allocate)(size);
if(buffer_p != NULL){
memset(buffer_p,0,size);
}
return buffer_p;
} }
else else
{ {
return calloc(1, size); buffer_p = calloc(1, size);
if(buffer_p != NULL){
memset(buffer_p,0,size);
}
return buffer_p;
} }
} }
......
...@@ -1536,7 +1536,7 @@ void pnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, ui ...@@ -1536,7 +1536,7 @@ void pnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, ui
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate PNF_P7 reassemby buffer len:%d\n", length); NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate PNF_P7 reassemby buffer len:%d\n", length);
return; return;
} }
memset(pnf_p7->reassemby_buffer, 0, length);
pnf_p7->reassemby_buffer_size = length; pnf_p7->reassemby_buffer_size = length;
} }
......
...@@ -1430,7 +1430,7 @@ void vnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7) ...@@ -1430,7 +1430,7 @@ void vnf_handle_p7_message(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate VNF_P7 reassemby buffer len:%d\n", length); NFAPI_TRACE(NFAPI_TRACE_NOTE, "Failed to allocate VNF_P7 reassemby buffer len:%d\n", length);
return; return;
} }
memset(phy->reassembly_buffer, 0, length);
phy->reassembly_buffer_size = length; phy->reassembly_buffer_size = length;
} }
......
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