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

Diff for /src/usr.bin/cvs/entries.c between version 1.52 and 1.53

version 1.52, 2005/12/03 15:02:55 version 1.53, 2005/12/10 20:27:45
Line 112 
Line 112 
                 return (NULL);                  return (NULL);
         }          }
   
         ep = (CVSENTRIES *)malloc(sizeof(CVSENTRIES));          ep = (CVSENTRIES *)xmalloc(sizeof(CVSENTRIES));
         if (ep == NULL) {  
                 cvs_log(LP_ERRNO, "failed to allocate Entries data");  
                 (void)fclose(fp);  
                 return (NULL);  
         }  
         memset(ep, 0, sizeof(*ep));          memset(ep, 0, sizeof(*ep));
   
         ep->cef_path = strdup(entpath);          ep->cef_path = xstrdup(entpath);
         if (ep->cef_path == NULL) {          ep->cef_bpath = xstrdup(bpath);
                 cvs_log(LP_ERRNO, "failed to copy Entries path");  
                 free(ep);  
                 (void)fclose(fp);  
                 return (NULL);  
         }  
   
         ep->cef_bpath = strdup(bpath);  
         if (ep->cef_bpath == NULL) {  
                 cvs_ent_close(ep);  
                 (void)fclose(fp);  
                 return (NULL);  
         }  
   
         ep->cef_cur = NULL;          ep->cef_cur = NULL;
         TAILQ_INIT(&(ep->cef_ent));          TAILQ_INIT(&(ep->cef_ent));
   
Line 224 
Line 206 
         }          }
   
         if (ep->cef_path != NULL)          if (ep->cef_path != NULL)
                 free(ep->cef_path);                  xfree(ep->cef_path);
   
         if (ep->cef_bpath != NULL)          if (ep->cef_bpath != NULL)
                 free(ep->cef_bpath);                  xfree(ep->cef_bpath);
   
         while (!TAILQ_EMPTY(&(ep->cef_ent))) {          while (!TAILQ_EMPTY(&(ep->cef_ent))) {
                 ent = TAILQ_FIRST(&(ep->cef_ent));                  ent = TAILQ_FIRST(&(ep->cef_ent));
Line 235 
Line 217 
                 cvs_ent_free(ent);                  cvs_ent_free(ent);
         }          }
   
         free(ep);          xfree(ep);
 }  }
   
   
Line 389 
Line 371 
         char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp;          char *fields[CVS_ENTRIES_NFIELDS], *buf, *sp, *dp;
         struct cvs_ent *ent;          struct cvs_ent *ent;
   
         buf = strdup(entry);          buf = xstrdup(entry);
         if (buf == NULL) {  
                 cvs_log(LP_ERRNO, "failed to allocate entry copy");  
                 return (NULL);  
         }  
   
         sp = buf;          sp = buf;
         i = 0;          i = 0;
         do {          do {
Line 410 
Line 387 
                 return (NULL);                  return (NULL);
         }          }
   
         ent = (struct cvs_ent *)malloc(sizeof(*ent));          ent = (struct cvs_ent *)xmalloc(sizeof(*ent));
         if (ent == NULL) {  
                 cvs_log(LP_ERRNO, "failed to allocate CVS entry");  
                 return (NULL);  
         }  
         memset(ent, 0, sizeof(*ent));          memset(ent, 0, sizeof(*ent));
         ent->ce_buf = buf;          ent->ce_buf = buf;
   
Line 472 
Line 445 
         if (ent->ce_rev != NULL)          if (ent->ce_rev != NULL)
                 rcsnum_free(ent->ce_rev);                  rcsnum_free(ent->ce_rev);
         if (ent->ce_buf != NULL)          if (ent->ce_buf != NULL)
                 free(ent->ce_buf);                  xfree(ent->ce_buf);
         free(ent);          xfree(ent);
 }  }
   
 /*  /*

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53