 
                            ...
In this noncompliant code example, the file identified by file_name is opened, processed, closed, and removed.:
| Code Block | ||||
|---|---|---|---|---|
| 
 | ||||
| char *file_name;
FILE *fp;
/* Initialize file_name */
fp = fopen(file_name, "w");
if (fp == NULL) {
  /* Handle error */
}
/*... process file ...*/
if (fclose(fp) != 0) {
  /* Handle error */
}
if (remove(file_name) != 0) {
  /* Handle error */
}
 | 
...
| [Open Group 2004] | dirname()realpath() | 
| [Viega 2003] | Section 2.4, "Determining Whether a Directory Is Secure" | 
...