Created
June 22, 2022 18:08
-
-
Save sl4v/e1d19834bca31ae6e8d94ce6fa3cc324 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main() | |
{ | |
puts("Basic allocation example.\n"); | |
char* a = malloc(0x10); | |
strcpy(a, "AAAAAAAAAAAAAAA"); // A * 15 | |
char* b = malloc(0x12); | |
memcpy(b, "BBBBBBBBBBBBBBBBBBBBBBBB", 24); // B * 23 | |
char* c = malloc(496); // was 0x200 | |
char* c = malloc(496); // was 0x200 | |
char* d = malloc(0x500); | |
char* e = malloc(0x500); | |
char* f = malloc(0x500); | |
char* g = malloc(0x500); | |
char* h = malloc(0x500); | |
free(a); | |
free(b); | |
free(c); | |
free(d); | |
// free(e); | |
free(f); | |
free(h); | |
free(g); | |
puts("End.\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment