if (id_len)
{
unsigned char *id = (unsigned char *) malloc(id_len);
+ if(id == 0){
+ fprintf(stderr, "tga_readheader: memory out\n");
+ return 0;
+ }
if ( !fread(id, id_len, 1, fp) )
{
fprintf(stderr, "\nError: fread return a number of element different from the expected.\n");
{
name = (char*)malloc(total+1);
if (name == NULL) {
+ fprintf(stderr, "imagetopgx: memory out\n");
goto fin;
}
}
fprintf(stderr," is written to the file\n");
}
destname = (char*)malloc(strlen(outfile) + 8);
-
+ if(destname == NULL){
+ fprintf(stderr, "imagetopnm: memory out\n");
+ fclose(fdest);
+ return 1;
+ }
for (compno = 0; compno < ncomp; compno++)
{
if (ncomp > 1)