Skip to content

Instantly share code, notes, and snippets.

@oknauta
Last active July 4, 2024 01:41
Show Gist options
  • Save oknauta/3817c8e86235d37b45e323a534fb3270 to your computer and use it in GitHub Desktop.
Save oknauta/3817c8e86235d37b45e323a534fb3270 to your computer and use it in GitHub Desktop.
Creating GARBAGE in memory using C!
// File: bad_malloc.c
// Date: 2024-05-21 | 2024-07-03
#include <stdlib.h> // Library to malloc
#include <stdbool.h> // Library to bool
int main()
{
while(true) // Loop to create the garbage.
{
malloc(1); // This crates the garbage.
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment