Skip to contentSkip to conversation

debugfs: add matching fclose

PATCH Applied Peng Tao 2 participants 2 messages Sep 28, 2009 – Oct 4, 2009

lore
Share & tools
lore

Peng Tao

author
#0 lore raw

PATCH 1/1 debugfs: add matching fclose

If the cmd_file is not stdin, we should close the file handle via fclose(). Thanks David Binderman to point this out.

Addresses-Novell-Bugzilla: #524526

---
 debugfs/debugfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
debugfs/debugfs.c +2 -0
index 93227e3..7f75788 100644
@@ -2133,6 +2133,8 @@ static int source_file(const char *cmd_file, int sci_idx)
 			exit_status++;
 		}
 	}
+	if (f != stdin)
+		fclose(f);
 	return exit_status;
 }
 
Signature · 1 line
1.6.5.rc2.262.g5224f
Applied
#1 lore raw
Quoted 6 lines · Peng Tao

If the cmd_file is not stdin, we should close the file handle via fclose(). Thanks David Binderman to point this out.

Addresses-Novell-Bugzilla: #524526

Applied to the maint branch, thanks.

- Ted