Initial commit
This commit is contained in:
14
kapitel19/leak1.c
Normal file
14
kapitel19/leak1.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char* buffer;
|
||||
buffer = malloc(sizeof(char)*15);
|
||||
*buffer = '\0';
|
||||
strcpy(buffer, "Hejsan svejsan");
|
||||
printf("%s\n", buffer);
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user