定义全局指针malloc遇到Hard Fault

定义全局指针malloc遇到Hard Fault

定义了一个全局指针:uint8_t *ReturnSignlocalhash = NULL;
_然后在在一个函数里面使用malloc
algorithm_log(" ======= 1 ======== ");
if( ReturnSignlocal == NULL ){
algorithm_log(" ======= 2 ======== ");
ReturnSignlocal = malloc(150);
}
memset(ReturnSignlocal,0,150);
然后发现执行到if语句的时候就直接Hard Fault 了。把uint8_t *ReturnSignlocalhash = NULL;改为局部的就ok了。

变量未初始化、使用大写、作用域