fixing leak
[oweals/gnunet.git] / src / monkey / bug_null_pointer_exception.c
index 072904b6da944430693f984917530d1c4aab0ac6..4accd65af60e9b169359fe9447a5539be010958d 100644 (file)
@@ -1,13 +1,17 @@
 #include <stdio.h>
 #include <string.h>
 
+
+struct CrashStruct {
+       const char *crashValue;
+};
+
 void crashFunction() 
 {
-       char *nullString = NULL;
+       struct CrashStruct *crashStruct;
+       crashStruct = NULL;
        printf("Now the program will crash!\n");
-       if (strcmp(nullString, "A string to compare with") == 0) {
-               printf("How come?! It had to crash!\n");
-       }
+       crashStruct->crashValue = "hello!";
 }
 
 int main(int argc, char *argv[])