[PATCH 08/13] Remove redundant readfile() in parse_csv_file

Anton Lundin glance at acc.umu.se
Tue Dec 10 15:53:32 UTC 2013


try_to_xslt_open_csv will read the file, so we don't need to do it
before that and leak that memory.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 file.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/file.c b/file.c
index 1e141b7..08c6a83 100644
--- a/file.c
+++ b/file.c
@@ -394,16 +394,6 @@ void parse_csv_file(const char *filename, int timef, int depthf, int tempf, int
 	if (filename == NULL)
 		return;
 
-	if (readfile(filename, &mem) < 0) {
-		if (error) {
-			int len = strlen(translate("gettextFromC","Failed to read '%s'")) + strlen(filename);
-			*error = malloc(len);
-			snprintf(*error, len, translate("gettextFromC","Failed to read '%s'"), filename);
-		}
-
-		return;
-	}
-
 	if (try_to_xslt_open_csv(filename, &mem, error))
 		return;
 
-- 
1.8.3.2



More information about the subsurface mailing list