Double-Free
小于 1 分钟
Double-Free
什么是Double-Free
#include <stdio.h>
#include <stdlib.h>
int main() {
int *ptr = (int*)malloc(sizeof(int));
*ptr = 5;
free(ptr);
free(ptr);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main() {
int *ptr = (int*)malloc(sizeof(int));
*ptr = 5;
free(ptr);
free(ptr);
return 0;
}