[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.17 and 1.18

version 1.17, 2007/04/18 19:03:04 version 1.18, 2007/09/02 15:19:33
Line 148 
Line 148 
   
         elf_fix_header(head);          elf_fix_header(head);
   
         if ((shdr = malloc(head->e_shentsize * head->e_shnum)) == NULL) {          if ((shdr = calloc(head->e_shentsize, head->e_shnum)) == NULL) {
                 warn("%s: malloc shdr", name);                  warn("%s: malloc shdr", name);
                 return (NULL);                  return (NULL);
         }          }
Line 174 
Line 174 
 {  {
         Elf_Phdr *phdr;          Elf_Phdr *phdr;
   
         if ((phdr = malloc(head->e_phentsize * head->e_phnum)) == NULL) {          if ((phdr = calloc(head->e_phentsize, head->e_phnum)) == NULL) {
                 warn("%s: malloc phdr", name);                  warn("%s: malloc phdr", name);
                 return (NULL);                  return (NULL);
         }          }
Line 473 
Line 473 
                                         MUNMAP(stab, *pstabsize);                                          MUNMAP(stab, *pstabsize);
                                 return (1);                                  return (1);
                         }                          }
                         if ((*psnames = malloc(*pnrawnames * sizeof(np))) == NULL) {                          if ((*psnames = calloc(*pnrawnames, sizeof(np))) == NULL) {
                                 warn("%s: malloc snames", name);                                  warn("%s: malloc snames", name);
                                 if (stab)                                  if (stab)
                                         MUNMAP(stab, *pstabsize);                                          MUNMAP(stab, *pstabsize);

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18