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.

double_free_interprocedure.c 341 B

3 years ago
12345678910111213141516171819202122
  1. /**
  2. * This file is a simple pointer double free case
  3. */
  4. #include <memory.h>
  5. #include <stdlib.h>
  6. #include <stdio.h>
  7. void subroutine(int* i_ptr) {
  8. free(i_ptr);
  9. }
  10. int main(void) {
  11. int* i_ptr = malloc(sizeof(int));
  12. if (i_ptr) {
  13. printf("malloc() success...\n");
  14. subroutine(i_ptr);
  15. // Use after free
  16. free(i_ptr);
  17. }
  18. }

No Description

Contributors (1)