Index: api/make_app_icon_h.cpp =================================================================== --- api/make_app_icon_h.cpp (révision 25749) +++ api/make_app_icon_h.cpp (copie de travail) @@ -41,7 +41,7 @@ outFile = fopen(argv[2], "w"); if (inFile == NULL) { printf ("Couldn't create output file %s\n", argv[2]); - fclose(inFile); + fclose(outFile); return 0; } Index: api/texfont.cpp =================================================================== --- api/texfont.cpp (révision 25749) +++ api/texfont.cpp (copie de travail) @@ -389,6 +389,12 @@ if (txf->teximage) free(txf->teximage); free(txf); } + if (texbitmap) { + free(texbitmap); + } + if (orig) { + free(orig); + } if (file) fclose(file); return NULL; } Index: api/texture.cpp =================================================================== --- api/texture.cpp (révision 25749) +++ api/texture.cpp (copie de travail) @@ -328,7 +328,10 @@ fread (&type, sizeof (char), 3, s); // read in colormap info and image type, byte 0 ignored fseek (s, 12, SEEK_SET); // seek past the header and useless info fread (&info, sizeof (char), 6, s); - if (type[1] != 0 || (type[2] != 2 && type[2] != 3)) return NULL; + if (type[1] != 0 || (type[2] != 2 && type[2] != 3)) { + fclose(s); + return NULL; + } (*width) = info[0] + info[1] * 256; (*height) = info[2] + info[3] * 256; imageBits = info[4]; Index: api/tgalib.cpp =================================================================== --- api/tgalib.cpp (révision 25749) +++ api/tgalib.cpp (copie de travail) @@ -125,8 +125,11 @@ } } // Else return a NULL for a bad or unsupported pixel format - else + else { + free(pImageData); + fclose(pFile); return NULL; + } } // Else, it must be Run-Length Encoded (RLE) else Index: vda/vdad.cpp =================================================================== --- vda/vdad.cpp (révision 25749) +++ vda/vdad.cpp (copie de travail) @@ -448,7 +448,10 @@ if (!f) return -1; for (int i=0; inapps, ssp->max_wu_results, app_indices, counts ); + free(weights); + free(counts); } else { napps = 1; } Index: sched/credit_test.cpp =================================================================== --- sched/credit_test.cpp (révision 25749) +++ sched/credit_test.cpp (copie de travail) @@ -351,6 +351,10 @@ double total_old_credit = 0; double total_new_credit = 0; FILE* in = fopen("credit_test_data", "r"); + if (in == NULL) { + printf("Impossible to open credit_test_data\n"); + exit(1); + } printf("min credit: %f\n", min_credit); while (!feof(in)) { int c = fscanf(in, "%d %d %d %d %lf %d %lf %lf %lf %lf", @@ -400,6 +404,7 @@ } if (n >= MAX_JOBS) break; } + fclose(in); fclose(f); if (nstats == 0) { printf("Insufficient jobs were read from DB\n"); Index: apps/concat.cpp =================================================================== --- apps/concat.cpp (révision 25749) +++ apps/concat.cpp (copie de travail) @@ -121,6 +121,7 @@ if (state) { fscanf(state, "%d %d", &file_num, &nchars); mode = "a"; + fclose(state); } else { file_num = (run_slow ? 2 : 1); nchars = 0;