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