What happens when you try to free() already freed memory in c?

后端 未结 14 1052
天命终不由人
天命终不由人 2020-12-09 08:19

For example:

char * myString = malloc(sizeof(char)*STRING_BUFFER_SIZE);
free(myString);
free(myString);

Are there any adverse side effects

14条回答
  •  眼角桃花
    2020-12-09 08:35

    Bad Things (TM)

    Really, I think it's undefined so anything at all including playing "Global Thermonuclear War" with NORAD's mainframe

提交回复
热议问题