[BACK]Return to elf.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / nm

Diff for /src/usr.bin/nm/elf.c between version 1.15 and 1.16

version 1.15, 2007/02/07 10:20:40 version 1.16, 2007/02/08 03:50:49
Line 447 
Line 447 
                         *pstabsize = shdr[i].sh_size;                          *pstabsize = shdr[i].sh_size;
                         if (*pstabsize > SIZE_T_MAX) {                          if (*pstabsize > SIZE_T_MAX) {
                                 warnx("%s: corrupt file", name);                                  warnx("%s: corrupt file", name);
                                 free(shstr);  
                                 return (1);                                  return (1);
                         }                          }
   
                         MMAP(stab, *pstabsize, PROT_READ, MAP_PRIVATE|MAP_FILE,                          MMAP(stab, *pstabsize, PROT_READ, MAP_PRIVATE|MAP_FILE,
                             fileno(fp), foff + shdr[i].sh_offset);                              fileno(fp), foff + shdr[i].sh_offset);
                         if (stab == MAP_FAILED) {                          if (stab == MAP_FAILED)
                                 free(shstr);  
                                 return (1);                                  return (1);
                         }  
                 }                  }
         }          }
         for (i = 0; i < eh->e_shnum; i++) {          for (i = 0; i < eh->e_shnum; i++) {
Line 466 
Line 463 
                                 warn("%s: fseeko", name);                                  warn("%s: fseeko", name);
                                 if (stab)                                  if (stab)
                                         MUNMAP(stab, *pstabsize);                                          MUNMAP(stab, *pstabsize);
                                 free(shstr);  
                                 return (1);                                  return (1);
                         }                          }
   
Line 475 
Line 471 
                                 warn("%s: malloc names", name);                                  warn("%s: malloc names", name);
                                 if (stab)                                  if (stab)
                                         MUNMAP(stab, *pstabsize);                                          MUNMAP(stab, *pstabsize);
                                 free(*pnames);  
                                 free(shstr);  
                                 return (1);                                  return (1);
                         }                          }
                         if ((*psnames = malloc(*pnrawnames * sizeof(np))) == NULL) {                          if ((*psnames = malloc(*pnrawnames * sizeof(np))) == NULL) {
                                 warn("%s: malloc snames", name);                                  warn("%s: malloc snames", name);
                                 if (stab)                                  if (stab)
                                         MUNMAP(stab, *pstabsize);                                          MUNMAP(stab, *pstabsize);
                                 free(shstr);  
                                 free(*pnames);                                  free(*pnames);
                                 free(*psnames);  
                                 return (1);                                  return (1);
                         }                          }
   
Line 495 
Line 487 
                                         warn("%s: read symbol", name);                                          warn("%s: read symbol", name);
                                         if (stab)                                          if (stab)
                                                 MUNMAP(stab, *pstabsize);                                                  MUNMAP(stab, *pstabsize);
                                         free(shstr);  
                                         free(*pnames);                                          free(*pnames);
                                         free(*psnames);                                          free(*psnames);
                                         return (1);                                          return (1);

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16