fix assertfatal cause by ue_type!=NOCE

This commit is contained in:
Wu Jing
2019-05-28 12:11:53 +09:00
parent 236c416fe2
commit a7bce4abd5
3 changed files with 13 additions and 4 deletions
+11 -2
View File
@@ -81,13 +81,22 @@ void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config)
if(size == 0)
return 0;
void* buffer_p = NULL;
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
{
return calloc(1, size);
buffer_p = calloc(1, size);
if(buffer_p != NULL){
memset(buffer_p,0,size);
}
return buffer_p;
}
}