Using pointer after free()

后端 未结 5 1846
抹茶落季
抹茶落季 2020-11-27 22:54

During my tests, I have found that it is possible to use pointer after free(). I have the following code:

typedef struct{

    int module_id;
    int adc_id;         


        
5条回答
  •  心在旅途
    2020-11-27 23:03

    Because using an invalid pointer invokes undefined behavior. And that means that the behavior is... well... undefined. It's not obliged to crash.

提交回复
热议问题