* viking -- GPS Data and Topo Analyzer, Explorer, and Manager
*
* Copyright (C) 2003-2008, Evan Battaglia <gtoevan@gmx.net>
+ * Copyright (C) 2007, Quy Tonthat <qtonthat@gmail.com>
*
* 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
/* Header */
f = g_fopen(file, "r");
- if ( !f )
+ if ( !f ) {
+ g_free ( rv );
return NULL;
+ }
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 */