mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Remove redundant readfile() in parse_csv_file
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@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c46ae27c3b
commit
9f7102f9da
1 changed files with 0 additions and 10 deletions
10
file.c
10
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue