2 ms·
// The Old Way (don't do this) char* include_pattern = NULL; if (optarg) { include_pattern = strdup(optarg); } // ...200 lines later... if (some
by kazinator 1y ago
// The Old Way (don't do this)
char* include_pattern = NULL;
if (optarg) {
include_pattern = strdup(optarg);
}
// ...200 lines later...
if (some_error) {
if (include_pattern) free(include_pattern); // Did I free it? Did I??
return 1;
Nope!
// ...200 lines later...
// common return block
out:
free(include_pattern); // free(NULL) allowed since before 1989 ANSI C
return result;