Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /libutil++/op_bfd.cpp [9ea7fb] .. [1081b2] Maximize Restore

  Switch to side-by-side view

--- a/libutil++/op_bfd.cpp
+++ b/libutil++/op_bfd.cpp
@@ -108,7 +108,7 @@
 	anon_obj(false),
 	vma_adj(0)
 {
-	int fd =  -1;
+	fd =  -1;
 	struct stat st;
 	// after creating all symbol it's convenient for user code to access
 	// symbols through a vector. We use an intermediate list to avoid a
@@ -178,8 +178,6 @@
 
 out:
 	add_symbols(symbols, symbol_filter);
-	if (fd != -1)
-		close(fd);
 	return;
 out_fail:
 	ibfd.close();
@@ -192,6 +190,8 @@
 
 op_bfd::~op_bfd()
 {
+	if (fd != -1)
+		close(fd);
 }