X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/65c1e0b03ad3fa552f965ace461be98ebd4e9fc1..78ac928c4967374d4c7ad5b3024f188074eab36b:/src/dem.c diff --git a/src/dem.c b/src/dem.c index 9c86a052..84c257e9 100644 --- a/src/dem.c +++ b/src/dem.c @@ -2,6 +2,7 @@ * viking -- GPS Data and Topo Analyzer, Explorer, and Manager * * Copyright (C) 2003-2008, Evan Battaglia + * Copyright (C) 2007, Quy Tonthat * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -448,6 +449,7 @@ VikDEM *vik_dem_new_from_file(const gchar *file) buffer[fread(buffer, 1, DEM_BLOCK_SIZE, f)] = '\0'; if ( ! dem_parse_header ( buffer, rv ) ) { g_free ( rv ); + fclose(f); return NULL; } /* TODO: actually use header -- i.e. GET # OF COLUMNS EXPECTED */