You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- /**
- * This file is a simple pointer double free case
- */
-
-
- #include <memory.h>
- #include <stdlib.h>
- #include <stdio.h>
-
- void subroutine(int* i_ptr) {
- free(i_ptr);
- }
-
- int main(void) {
- int* i_ptr = malloc(sizeof(int));
- if (i_ptr) {
- printf("malloc() success...\n");
- subroutine(i_ptr);
- // Use after free
- free(i_ptr);
- }
- }
|