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

Diff for /src/usr.bin/cvs/trigger.c between version 1.22 and 1.23

version 1.22, 2015/01/16 06:40:07 version 1.23, 2015/11/05 09:48:21
Line 322 
Line 322 
                         expanded = 1;                          expanded = 1;
                 }                  }
   
                 if (q != NULL)                  free(q);
                         xfree(q);  
         }          }
   
         if (!expanded && default_args != NULL) {          if (!expanded && default_args != NULL) {
Line 336 
Line 335 
         return (buf_release(buf));          return (buf_release(buf));
   
 bad:  bad:
         if (q != NULL)          free(q);
                 xfree(q);  
         cvs_log(LP_NOTICE, "%s contains malformed command '%s'", file, cmd);          cvs_log(LP_NOTICE, "%s contains malformed command '%s'", file, cmd);
         buf_free(buf);          buf_free(buf);
         return (NULL);          return (NULL);
Line 359 
Line 357 
                 case CVS_TRIGGER_TAGINFO:                  case CVS_TRIGGER_TAGINFO:
                 case CVS_TRIGGER_VERIFYMSG:                  case CVS_TRIGGER_VERIFYMSG:
                         if ((r = cvs_exec(cmd, NULL, 1)) != 0) {                          if ((r = cvs_exec(cmd, NULL, 1)) != 0) {
                                 xfree(cmd);                                  free(cmd);
                                 return (r);                                  return (r);
                         }                          }
                         break;                          break;
Line 367 
Line 365 
                         (void)cvs_exec(cmd, in, 1);                          (void)cvs_exec(cmd, in, 1);
                         break;                          break;
                 }                  }
                 xfree(cmd);                  free(cmd);
         }          }
   
         return (0);          return (0);
Line 460 
Line 458 
                 }                  }
         }          }
   
         if (nline != NULL)          free(nline);
                 xfree(nline);  
   
         if (defaultline != NULL) {          if (defaultline != NULL) {
                 if (!match) {                  if (!match) {
Line 469 
Line 466 
                         tline->line = defaultline;                          tline->line = defaultline;
                         TAILQ_INSERT_HEAD(list, tline, flist);                          TAILQ_INSERT_HEAD(list, tline, flist);
                 } else                  } else
                         xfree(defaultline);                          free(defaultline);
         }          }
   
         (void)fclose(fp);          (void)fclose(fp);
   
         if (TAILQ_EMPTY(list)) {          if (TAILQ_EMPTY(list)) {
                 xfree(list);                  free(list);
                 list = NULL;                  list = NULL;
         }          }
   
Line 483 
Line 480 
   
 bad:  bad:
         cvs_log(LP_NOTICE, "%s: malformed line %d", file, lineno);          cvs_log(LP_NOTICE, "%s: malformed line %d", file, lineno);
           free(defaultline);
         if (defaultline != NULL)  
                 xfree(defaultline);  
         cvs_trigger_freelist(list);          cvs_trigger_freelist(list);
   
         (void)fclose(fp);          (void)fclose(fp);
Line 500 
Line 495 
   
         while ((line = TAILQ_FIRST(list)) != NULL) {          while ((line = TAILQ_FIRST(list)) != NULL) {
                 TAILQ_REMOVE(list, line, flist);                  TAILQ_REMOVE(list, line, flist);
                 xfree(line->line);                  free(line->line);
                 xfree(line);                  free(line);
         }          }
   
         xfree(list);          free(list);
 }  }
   
 void  void
Line 515 
Line 510 
         while ((fi = TAILQ_FIRST(list)) != NULL) {          while ((fi = TAILQ_FIRST(list)) != NULL) {
                 TAILQ_REMOVE(list, fi, flist);                  TAILQ_REMOVE(list, fi, flist);
   
                 if (fi->file_path != NULL)                  free(fi->file_path);
                         xfree(fi->file_path);                  free(fi->file_wd);
                 if (fi->file_wd != NULL)                  free(fi->crevstr);
                         xfree(fi->file_wd);                  free(fi->nrevstr);
                 if (fi->crevstr != NULL)                  free(fi->tag_new);
                         xfree(fi->crevstr);                  free(fi->tag_old);
                 if (fi->nrevstr != NULL)                  free(fi);
                         xfree(fi->nrevstr);  
                 if (fi->tag_new != NULL)  
                         xfree(fi->tag_new);  
                 if (fi->tag_old != NULL)  
                         xfree(fi->tag_old);  
   
                 xfree(fi);  
         }          }
 }  }
   

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23