@@ -1,15 +1,14 @@ -void a_function() { +bool a_function() { char *s1 = malloc(A_NUMBER); if (!s1) { - fprintf(stderr, "out of memory, exitting\n"); - exit(1); + return false; } strcpy(s1, "some string"); char *s2 = malloc(A_NUMBER); if (!s2) { - fprintf(stderr, "out of memory, exitting\n"); - exit(1); + free(s1); + return false; } strcpy(s2, "another string"); }