src/medit/gisfil.c:69: error: RESOURCE_LEAK resource of type `_IO_FILE` acquired by call to `fopen()` at line 23, column 8 is not released after line 69, column 13. Showing all 24 steps of the trace src/medit/gisfil.c:7:1: start of procedure loadGIS() 5. #define FLOAT_MAX 1.e20 6. 7. > int loadGIS(pMesh mesh) { 8. pQuad pq; 9. pPoint ppt; src/medit/gisfil.c:20:3: 18. 19. /* default */ 20. > strcpy(data,mesh->name); 21. ptr = strstr(data,".gis"); 22. if ( !ptr ) strcat(data,".gis"); src/medit/gisfil.c:21:3: 19. /* default */ 20. strcpy(data,mesh->name); 21. > ptr = strstr(data,".gis"); 22. if ( !ptr ) strcat(data,".gis"); 23. fp = fopen(data,"rb"); src/medit/gisfil.c:22:9: Taking true branch 20. strcpy(data,mesh->name); 21. ptr = strstr(data,".gis"); 22. if ( !ptr ) strcat(data,".gis"); ^ 23. fp = fopen(data,"rb"); 24. if ( !fp ) return(0); src/medit/gisfil.c:22:16: 20. strcpy(data,mesh->name); 21. ptr = strstr(data,".gis"); 22. > if ( !ptr ) strcat(data,".gis"); 23. fp = fopen(data,"rb"); 24. if ( !fp ) return(0); src/medit/gisfil.c:23:3: 21. ptr = strstr(data,".gis"); 22. if ( !ptr ) strcat(data,".gis"); 23. > fp = fopen(data,"rb"); 24. if ( !fp ) return(0); 25. fprintf(stdout," Reading %s\n",data); src/medit/gisfil.c:24:9: Taking false branch 22. if ( !ptr ) strcat(data,".gis"); 23. fp = fopen(data,"rb"); 24. if ( !fp ) return(0); ^ 25. fprintf(stdout," Reading %s\n",data); 26. src/medit/gisfil.c:25:3: 23. fp = fopen(data,"rb"); 24. if ( !fp ) return(0); 25. > fprintf(stdout," Reading %s\n",data); 26. 27. if ( !fgets(buf,sizeof(buf),fp) ) { src/medit/gisfil.c:27:9: Taking false branch 25. fprintf(stdout," Reading %s\n",data); 26. 27. if ( !fgets(buf,sizeof(buf),fp) ) { ^ 28. fprintf(stderr," ## Invalid header.\n"); 29. return(0); src/medit/gisfil.c:33:3: 31. 32. /* remove leading spaces */ 33. > pos = 0; 34. while ( (buf[0] == ' ') && (buf[0] != 0x0d) && (buf[0] != 0x0a) ) 35. memmove(&buf[0],&buf[1],strlen(buf)); src/medit/gisfil.c:34:12: Loop condition is false. Leaving loop 32. /* remove leading spaces */ 33. pos = 0; 34. while ( (buf[0] == ' ') && (buf[0] != 0x0d) && (buf[0] != 0x0a) ) ^ 35. memmove(&buf[0],&buf[1],strlen(buf)); 36. src/medit/gisfil.c:38:8: Taking false branch 36. 37. /* check header file */ 38. if ( buf[0] != 'G' ) { ^ 39. fprintf(stderr," ## Invalid format.\n"); 40. return(0); src/medit/gisfil.c:42:8: Taking true branch 40. return(0); 41. } 42. if ( buf[1] == '1' ) ityp = 1; ^ 43. else if ( buf[1] == '2' ) ityp = 2; 44. else { src/medit/gisfil.c:42:30: 40. return(0); 41. } 42. > if ( buf[1] == '1' ) ityp = 1; 43. else if ( buf[1] == '2' ) ityp = 2; 44. else { src/medit/gisfil.c:51:5: 49. /* check and strip comments */ 50. do { 51. > ret = fscanf(fp,"%s",buf); 52. if ( ret == EOF ) break; 53. if ( buf[0] == '#' ) src/medit/gisfil.c:52:10: Taking true branch 50. do { 51. ret = fscanf(fp,"%s",buf); 52. if ( ret == EOF ) break; ^ 53. if ( buf[0] == '#' ) 54. do src/medit/gisfil.c:62:3: 60. 61. /* header */ 62. > ret = sscanf(buf,"%d",&sx); 63. ret += fscanf(fp,"%d",&sy); 64. ret += fscanf(fp,"%f %f %f",&cx,&cy,&cz); src/medit/gisfil.c:63:3: 61. /* header */ 62. ret = sscanf(buf,"%d",&sx); 63. > ret += fscanf(fp,"%d",&sy); 64. ret += fscanf(fp,"%f %f %f",&cx,&cy,&cz); 65. ret += fscanf(fp,"%f",&gu); src/medit/gisfil.c:64:3: 62. ret = sscanf(buf,"%d",&sx); 63. ret += fscanf(fp,"%d",&sy); 64. > ret += fscanf(fp,"%f %f %f",&cx,&cy,&cz); 65. ret += fscanf(fp,"%f",&gu); 66. ret += fscanf(fp,"%f",&hu); src/medit/gisfil.c:65:3: 63. ret += fscanf(fp,"%d",&sy); 64. ret += fscanf(fp,"%f %f %f",&cx,&cy,&cz); 65. > ret += fscanf(fp,"%f",&gu); 66. ret += fscanf(fp,"%f",&hu); 67. ret += fscanf(fp,"%f %f",&xmi,&ymi); src/medit/gisfil.c:66:3: 64. ret += fscanf(fp,"%f %f %f",&cx,&cy,&cz); 65. ret += fscanf(fp,"%f",&gu); 66. > ret += fscanf(fp,"%f",&hu); 67. ret += fscanf(fp,"%f %f",&xmi,&ymi); 68. if ( ret != 9 ) { src/medit/gisfil.c:67:3: 65. ret += fscanf(fp,"%f",&gu); 66. ret += fscanf(fp,"%f",&hu); 67. > ret += fscanf(fp,"%f %f",&xmi,&ymi); 68. if ( ret != 9 ) { 69. fprintf(stderr," ## Error loading terrain.\n"); src/medit/gisfil.c:68:8: Taking true branch 66. ret += fscanf(fp,"%f",&hu); 67. ret += fscanf(fp,"%f %f",&xmi,&ymi); 68. if ( ret != 9 ) { ^ 69. fprintf(stderr," ## Error loading terrain.\n"); 70. free(mesh); src/medit/gisfil.c:69:5: 67. ret += fscanf(fp,"%f %f",&xmi,&ymi); 68. if ( ret != 9 ) { 69. > fprintf(stderr," ## Error loading terrain.\n"); 70. free(mesh); 71. return(0);