diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/add.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/admin.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/annotate.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 36 | ||||
-rw-r--r-- | usr.bin/cvs/diff.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/edit.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/entries.c | 7 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/getlog.c | 7 | ||||
-rw-r--r-- | usr.bin/cvs/history.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/import.c | 10 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.c | 60 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/rcsnum.c | 15 | ||||
-rw-r--r-- | usr.bin/cvs/rcsparse.c | 16 | ||||
-rw-r--r-- | usr.bin/cvs/tag.c | 15 | ||||
-rw-r--r-- | usr.bin/cvs/update.c | 9 | ||||
-rw-r--r-- | usr.bin/cvs/util.c | 6 |
18 files changed, 98 insertions, 127 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index 6d79296403a..2008635d91b 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.112 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: add.c,v 1.113 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -485,8 +485,7 @@ add_file(struct cvs_file *cf) break; } - if (head != NULL) - rcsnum_free(head); + free(head); if (stop == 1) return; diff --git a/usr.bin/cvs/admin.c b/usr.bin/cvs/admin.c index 543fbcc71ac..89d10a8f0dd 100644 --- a/usr.bin/cvs/admin.c +++ b/usr.bin/cvs/admin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: admin.c,v 1.66 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: admin.c,v 1.67 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005 Joris Vink <joris@openbsd.org> @@ -334,11 +334,11 @@ cvs_admin_local(struct cvs_file *cf) if (rcs_rev_setlog(cf->file_rcs, rev, logmsg) < 0) { cvs_log(LP_ERR, "failed to set logmsg for `%s' to `%s'", logstr, logmsg); - rcsnum_free(rev); + free(rev); return; } - rcsnum_free(rev); + free(rev); } if (orange != NULL) { @@ -380,7 +380,7 @@ cvs_admin_local(struct cvs_file *cf) (void)rcs_state_set(cf->file_rcs, rev, state); - rcsnum_free(rev); + free(rev); } if (lkmode != RCS_LOCK_INVAL) diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index a2727c6388d..cb09f306cfe 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.66 2016/10/12 11:11:56 fcambus Exp $ */ +/* $OpenBSD: annotate.c,v 1.67 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann <tobias@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -179,7 +179,7 @@ cvs_annotate_local(struct cvs_file *cf) rev = rcsnum_parse(cvs_specified_tag); if (rev == NULL) fatal("no such tag %s", cvs_specified_tag); - rcsnum_free(rev); + free(rev); rev = rcsnum_alloc(); rcsnum_cpy(cf->file_rcs->rf_head, rev, 0); } @@ -206,9 +206,9 @@ cvs_annotate_local(struct cvs_file *cf) */ if (bnum != rev) { rcs_annotate_getlines(cf->file_rcs, rev, &alines); - rcsnum_free(bnum); + free(bnum); } - rcsnum_free(rev); + free(rev); } else { rcs_rev_getlines(cf->file_rcs, (cvs_specified_date != -1 || cvs_directory_date != -1) ? cf->file_rcsrev : diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 60f06612da0..fa4102a8c37 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.154 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: commit.c,v 1.155 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -365,7 +365,7 @@ cvs_commit_check_files(struct cvs_file *cf) if (brev != NULL) { if (RCSNUM_ISBRANCH(brev)) goto next; - rcsnum_free(brev); + free(brev); } brev = rcs_translate_tag(tag, cf->file_rcs); @@ -382,7 +382,7 @@ cvs_commit_check_files(struct cvs_file *cf) "a branch for file %s", tag, cf->file_path); conflicts_found++; - rcsnum_free(brev); + free(brev); return; } @@ -391,8 +391,8 @@ cvs_commit_check_files(struct cvs_file *cf) "a branch for file %s", tag, cf->file_path); conflicts_found++; - rcsnum_free(branch); - rcsnum_free(brev); + free(branch); + free(brev); return; } @@ -401,18 +401,16 @@ cvs_commit_check_files(struct cvs_file *cf) "a branch for file %s", tag, cf->file_path); conflicts_found++; - rcsnum_free(branch); - rcsnum_free(brev); + free(branch); + free(brev); return; } } } next: - if (branch != NULL) - rcsnum_free(branch); - if (brev != NULL) - rcsnum_free(brev); + free(branch); + free(brev); if (cf->file_status != FILE_ADDED && cf->file_status != FILE_REMOVED && @@ -488,7 +486,7 @@ cvs_commit_local(struct cvs_file *cf) d = NULL; if (cf->file_rcs != NULL && cf->file_rcs->rf_branch != NULL) { - rcsnum_free(cf->file_rcs->rf_branch); + free(cf->file_rcs->rf_branch); cf->file_rcs->rf_branch = NULL; } @@ -500,8 +498,8 @@ cvs_commit_local(struct cvs_file *cf) cf->file_path); if (tag != NULL) { - rcsnum_free(crev); - rcsnum_free(rrev); + free(crev); + free(rrev); brev = rcs_sym_getrev(cf->file_rcs, tag); crev = rcs_translate_tag(tag, cf->file_rcs); if (brev == NULL || crev == NULL) { @@ -525,8 +523,8 @@ cvs_commit_local(struct cvs_file *cf) fatal("this isnt suppose to happen, honestly"); } - rcsnum_free(brev); - rcsnum_free(rrev); + free(brev); + free(rrev); rrev = rcsnum_branch_root(nrev); /* branch stuff was checked in cvs_commit_check_files */ @@ -538,8 +536,7 @@ cvs_commit_local(struct cvs_file *cf) strlcpy(rbuf, "Non-existent", sizeof(rbuf)); } - if (rrev != NULL) - rcsnum_free(rrev); + free(rrev); isnew = 0; if (cf->file_status == FILE_ADDED) { isnew = 1; @@ -715,8 +712,7 @@ cvs_commit_local(struct cvs_file *cf) break; } - if (crev != NULL) - rcsnum_free(crev); + free(crev); if (histtype != -1) cvs_history_add(histtype, cf, NULL); diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index 7f4f575385d..d9b3c83452a 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.161 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: diff.c,v 1.162 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2008 Tobias Stoeckmann <tobias@openbsd.org> * Copyright (c) 2006 Joris Vink <joris@openbsd.org> @@ -407,7 +407,7 @@ cvs_diff_local(struct cvs_file *cf) /* -f is not allowed for unknown symbols */ if ((diff_rev1 = rcsnum_parse(rev1)) == NULL) fatal("no such tag %s", rev1); - rcsnum_free(diff_rev1); + free(diff_rev1); diff_rev1 = cf->file_rcs->rf_head; } @@ -444,7 +444,7 @@ cvs_diff_local(struct cvs_file *cf) /* -f is not allowed for unknown symbols */ if ((diff_rev2 = rcsnum_parse(rev2)) == NULL) fatal("no such tag %s", rev2); - rcsnum_free(diff_rev2); + free(diff_rev2); diff_rev2 = cf->file_rcs->rf_head; } diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c index 8d79e36d4a2..65fc5802b92 100644 --- a/usr.bin/cvs/edit.c +++ b/usr.bin/cvs/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.51 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: edit.c,v 1.52 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria <xsa@openbsd.org> * @@ -413,7 +413,7 @@ cvs_unedit_local(struct cvs_file *cf) free(entry); } - rcsnum_free(ba_rev); + free(ba_rev); (void)cvs_base_handle(cf, BASE_REMOVE); diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index c1a18d128ea..36ecef8e680 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.106 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: entries.c,v 1.107 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -385,8 +385,7 @@ cvs_ent_line_str(const char *name, char *rev, char *tstamp, char *opts, void cvs_ent_free(struct cvs_ent *ent) { - if (ent->ce_rev != NULL) - rcsnum_free(ent->ce_rev); + free(ent->ce_rev); free(ent->ce_time); free(ent->ce_buf); free(ent); @@ -533,7 +532,7 @@ cvs_write_tagfile(const char *dir, char *tag, char *date) if ((rev = rcsnum_parse(tag)) != NULL) { (void)xsnprintf(sticky, sizeof(sticky), "N%s", tag); - rcsnum_free(rev); + free(rev); } else { (void)xsnprintf(sticky, sizeof(sticky), "T%s", tag); diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index 602c0b2e236..bc218080272 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.267 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: file.c,v 1.268 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -977,9 +977,7 @@ cvs_file_free(struct cvs_file *cf) free(cf->file_name); free(cf->file_wd); free(cf->file_path); - - if (cf->file_rcsrev != NULL) - rcsnum_free(cf->file_rcsrev); + free(cf->file_rcsrev); free(cf->file_rpath); if (cf->file_ent != NULL) cvs_ent_free(cf->file_ent); diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c index 461cd32c5bd..68347c4c13d 100644 --- a/usr.bin/cvs/getlog.c +++ b/usr.bin/cvs/getlog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getlog.c,v 1.98 2014/12/01 21:58:46 deraadt Exp $ */ +/* $OpenBSD: getlog.c,v 1.99 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> * Copyright (c) 2006 Joris Vink <joris@openbsd.org> @@ -17,6 +17,7 @@ */ #include <unistd.h> +#include <stdlib.h> #include <string.h> #include <errno.h> #include <ctype.h> @@ -276,7 +277,7 @@ cvs_log_local(struct cvs_file *cf) cvs_printf("\t%s: %s\n", sym->rs_name, rcsnum_tostr(rev, numb, sizeof(numb))); - rcsnum_free(rev); + free(rev); } } @@ -393,7 +394,7 @@ log_rev_print(struct rcs_delta *rdp) branch = rcsnum_revtobr(rb->rb_num); rcsnum_tostr(branch, numb, sizeof(numb)); cvs_printf(" %s;", numb); - rcsnum_free(branch); + free(branch); } cvs_printf("\n"); } diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c index d9f445ee011..f97e8fdbe1c 100644 --- a/usr.bin/cvs/history.c +++ b/usr.bin/cvs/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.43 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: history.c,v 1.44 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2007 Joris Vink <joris@openbsd.org> * @@ -157,7 +157,7 @@ cvs_history_add(int type, struct cvs_file *cf, const char *argument) if ((hrev = rcs_head_get(cf->file_rcs)) == NULL) fatal("cvs_history_add: rcs_head_get failed"); rcsnum_tostr(hrev, revbuf, sizeof(revbuf)); - rcsnum_free(hrev); + free(hrev); break; } diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index 445d8e23e46..5b2aa94cbda 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.105 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: import.c,v 1.106 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -371,8 +371,8 @@ import_new(struct cvs_file *cf) rcs_write(cf->file_rcs); import_printf("N %s/%s\n", import_repository, cf->file_path); - rcsnum_free(branch); - rcsnum_free(brev); + free(branch); + free(brev); } static void @@ -403,7 +403,7 @@ import_update(struct cvs_file *cf) buf_free(b2); if (ret == 0) { import_tag(cf, brev, rev); - rcsnum_free(brev); + free(brev); if (cvs_noexec != 1) rcs_write(cf->file_rcs); import_printf("U %s/%s\n", import_repository, cf->file_path); @@ -438,7 +438,7 @@ import_update(struct cvs_file *cf) if (kflag) rcs_kwexp_set(cf->file_rcs, kflag); - rcsnum_free(brev); + free(brev); rcs_write(cf->file_rcs); } diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index b1eed5bd21f..9a286df761c 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.314 2016/10/13 20:31:45 millert Exp $ */ +/* $OpenBSD: rcs.c,v 1.315 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -243,7 +243,7 @@ rcs_close(RCSFILE *rfp) while (!TAILQ_EMPTY(&(rfp->rf_symbols))) { rsp = TAILQ_FIRST(&(rfp->rf_symbols)); TAILQ_REMOVE(&(rfp->rf_symbols), rsp, rs_list); - rcsnum_free(rsp->rs_num); + free(rsp->rs_num); free(rsp->rs_name); free(rsp); } @@ -251,15 +251,13 @@ rcs_close(RCSFILE *rfp) while (!TAILQ_EMPTY(&(rfp->rf_locks))) { rlp = TAILQ_FIRST(&(rfp->rf_locks)); TAILQ_REMOVE(&(rfp->rf_locks), rlp, rl_list); - rcsnum_free(rlp->rl_num); + free(rlp->rl_num); free(rlp->rl_name); free(rlp); } - if (rfp->rf_head != NULL) - rcsnum_free(rfp->rf_head); - if (rfp->rf_branch != NULL) - rcsnum_free(rfp->rf_branch); + free(rfp->rf_head); + free(rfp->rf_branch); if (rfp->rf_file != NULL) fclose(rfp->rf_file); @@ -468,7 +466,7 @@ rcs_head_get(RCSFILE *file) file->rf_branch->rn_len) == 0) break; } - rcsnum_free(rootrev); + free(rootrev); if (brp == NULL) fatal("rcs_head_get: could not find first default " @@ -533,7 +531,7 @@ rcs_branch_new(RCSFILE *file, RCSNUM *rev) if (rcsnum_inc(brev) == NULL || rcsnum_inc(brev) == NULL) { - rcsnum_free(brev); + free(brev); return (NULL); } } @@ -682,7 +680,7 @@ rcs_sym_remove(RCSFILE *file, const char *sym) TAILQ_REMOVE(&(file->rf_symbols), symp, rs_list); free(symp->rs_name); - rcsnum_free(symp->rs_num); + free(symp->rs_num); free(symp); /* not synced anymore */ @@ -858,7 +856,7 @@ rcs_lock_remove(RCSFILE *file, const char *user, RCSNUM *rev) return (-1); TAILQ_REMOVE(&(file->rf_locks), lkp, rl_list); - rcsnum_free(lkp->rl_num); + free(lkp->rl_num); free(lkp->rl_name); free(lkp); @@ -1209,8 +1207,7 @@ rcs_rev_add(RCSFILE *rf, RCSNUM *rev, const char *msg, time_t date, } } - if (root != NULL) - rcsnum_free(root); + free(root); /* not synced anymore */ rf->rf_flags &= ~RCS_SYNCED; @@ -1292,10 +1289,10 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) if (rcs_head_set(rf, prevrdp->rd_num) < 0) fatal("rcs_head_set failed"); } else if (nextrdp != NULL) { - rcsnum_free(nextrdp->rd_next); + free(nextrdp->rd_next); nextrdp->rd_next = rcsnum_alloc(); } else { - rcsnum_free(rf->rf_head); + free(rf->rf_head); rf->rf_head = NULL; } @@ -1451,11 +1448,8 @@ rcs_freedelta(struct rcs_delta *rdp) { struct rcs_branch *rb; - if (rdp->rd_num != NULL) - rcsnum_free(rdp->rd_num); - if (rdp->rd_next != NULL) - rcsnum_free(rdp->rd_next); - + free(rdp->rd_num); + free(rdp->rd_next); free(rdp->rd_author); free(rdp->rd_locker); free(rdp->rd_state); @@ -1464,7 +1458,7 @@ rcs_freedelta(struct rcs_delta *rdp) while ((rb = TAILQ_FIRST(&(rdp->rd_branches))) != NULL) { TAILQ_REMOVE(&(rdp->rd_branches), rb, rb_list); - rcsnum_free(rb->rb_num); + free(rb->rb_num); free(rb); } @@ -1682,7 +1676,7 @@ rcs_get_revision(const char *revstr, RCSFILE *rfp) */ if (rfp->rf_head == NULL || rcsnum_cmp(rev, rfp->rf_head, MINIMUM(rfp->rf_head->rn_len, rev->rn_len)) < 0) { - rcsnum_free(rev); + free(rev); return (NULL); } return (rev); @@ -1693,7 +1687,7 @@ rcs_get_revision(const char *revstr, RCSFILE *rfp) if ((rdp = rcs_findrev(rfp, brev)) == NULL) fatal("rcs_get_revision: tag `%s' does not exist", revstr); - rcsnum_free(brev); + free(brev); TAILQ_FOREACH(brp, &(rdp->rd_branches), rb_list) { for (i = 0; i < rev->rn_len; i++) @@ -1704,7 +1698,7 @@ rcs_get_revision(const char *revstr, RCSFILE *rfp) break; } - rcsnum_free(rev); + free(rev); frev = rcsnum_alloc(); if (brp == NULL) { rcsnum_cpy(rdp->rd_num, frev, 0); @@ -1781,7 +1775,7 @@ rcs_rev_getlines(RCSFILE *rfp, RCSNUM *frev, struct rcs_line ***alines) annotate = ANNOTATE_NOW; /* annotate down to 1.1 from where we are */ - rcsnum_free(bnum); + free(bnum); bnum = rcsnum_parse("1.1"); if (!rcsnum_differ(rdp->rd_num, bnum)) { goto next; @@ -1838,7 +1832,7 @@ again: annotate = ANNOTATE_NOW; /* annotate down to 1.1 from where we are */ - rcsnum_free(bnum); + free(bnum); bnum = rcsnum_parse("1.1"); if (!rcsnum_differ(rdp->rd_num, bnum)) @@ -1870,7 +1864,7 @@ next: free(*alines); *alines = NULL; cvs_freelines(dlines); - rcsnum_free(bnum); + free(bnum); return (NULL); } fatal("expected branch not found on branch list"); @@ -1902,7 +1896,7 @@ done: } if (bnum != tnum) - rcsnum_free(bnum); + free(bnum); return (dlines); } @@ -2000,7 +1994,7 @@ rcs_annotate_getlines(RCSFILE *rfp, RCSNUM *frev, struct rcs_line ***alines) } while (rcsnum_differ(rdp->rd_num, frev)); if (bnum != frev) - rcsnum_free(bnum); + free(bnum); /* * All lines have been parsed, now they must be copied over @@ -2586,7 +2580,7 @@ rcs_translate_tag(const char *revstr, RCSFILE *rfp) } else follow = 0; - rcsnum_free(brev); + free(brev); } if (cvs_specified_date != -1) @@ -2601,7 +2595,7 @@ rcs_translate_tag(const char *revstr, RCSFILE *rfp) } /* Find the latest delta on that branch */ - rcsnum_free(rev); + free(rev); for (;;) { if (rdp->rd_next->rn_len == 0) break; @@ -2618,10 +2612,10 @@ rcs_translate_tag(const char *revstr, RCSFILE *rfp) if (frev != NULL) { brev = rcsnum_revtobr(frev); brev->rn_len = rev->rn_len - 1; - rcsnum_free(frev); + free(frev); } - rcsnum_free(rev); + free(rev); do { deltatime = timegm(&(rdp->rd_date)); diff --git a/usr.bin/cvs/rcs.h b/usr.bin/cvs/rcs.h index 5de9ec59a0f..36c8812c590 100644 --- a/usr.bin/cvs/rcs.h +++ b/usr.bin/cvs/rcs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.h,v 1.101 2013/06/03 17:04:35 jcs Exp $ */ +/* $OpenBSD: rcs.h,v 1.102 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -263,7 +263,6 @@ RCSNUM *rcsnum_inc(RCSNUM *); RCSNUM *rcsnum_dec(RCSNUM *); RCSNUM *rcsnum_branch_root(RCSNUM *); RCSNUM *rcsnum_new_branch(RCSNUM *); -void rcsnum_free(RCSNUM *); int rcsnum_addmagic(RCSNUM *); int rcsnum_aton(const char *, char **, RCSNUM *); char *rcsnum_tostr(const RCSNUM *, char *, size_t); diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c index b33fa0a5ba5..3260a5c9d6f 100644 --- a/usr.bin/cvs/rcsnum.c +++ b/usr.bin/cvs/rcsnum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsnum.c,v 1.57 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.58 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -82,7 +82,7 @@ rcsnum_parse(const char *str) num = rcsnum_alloc(); if (rcsnum_aton(str, &ep, num) < 0 || *ep != '\0') { - rcsnum_free(num); + free(num); num = NULL; } @@ -90,17 +90,6 @@ rcsnum_parse(const char *str) } /* - * rcsnum_free() - * - * Free an RCSNUM structure previously allocated with rcsnum_alloc(). - */ -void -rcsnum_free(RCSNUM *rn) -{ - free(rn); -} - -/* * rcsnum_tostr() * * Format the RCS number <nump> into a human-readable dot-separated diff --git a/usr.bin/cvs/rcsparse.c b/usr.bin/cvs/rcsparse.c index 8e5a7340127..fb96436ff92 100644 --- a/usr.bin/cvs/rcsparse.c +++ b/usr.bin/cvs/rcsparse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsparse.c,v 1.12 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: rcsparse.c,v 1.13 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2010 Tobias Stoeckmann <tobias@openbsd.org> * @@ -343,7 +343,7 @@ rcsparse_free(RCSFILE *rfp) free(pdp->rp_buf); if (pdp->rp_token == RCS_TYPE_REVISION) - rcsnum_free(pdp->rp_value.rev); + free(pdp->rp_value.rev); free(pdp); } @@ -557,12 +557,12 @@ rcsparse_textrevision(RCSFILE *rfp, struct rcs_pdata *pdp) if (rdp == NULL) { rcsparse_warnx(rfp, "delta for revision \"%s\" not found", pdp->rp_buf); - rcsnum_free(pdp->rp_value.rev); + free(pdp->rp_value.rev); return (1); } pdp->rp_delta = rdp; - rcsnum_free(pdp->rp_value.rev); + free(pdp->rp_value.rev); return (0); } @@ -1028,7 +1028,7 @@ rcsparse_token(RCSFILE *rfp, int allowed) return (0); } if (datenum->rn_len != 6) { - rcsnum_free(datenum); + free(datenum); rcsparse_warnx(rfp, "invalid date \"%s\"", pdp->rp_buf); return (0); } @@ -1040,7 +1040,7 @@ rcsparse_token(RCSFILE *rfp, int allowed) pdp->rp_value.date.tm_hour = datenum->rn_id[3]; pdp->rp_value.date.tm_min = datenum->rn_id[4]; pdp->rp_value.date.tm_sec = datenum->rn_id[5]; - rcsnum_free(datenum); + free(datenum); break; case RCS_TYPE_NUMBER: pdp->rp_value.rev = rcsnum_parse(pdp->rp_buf); @@ -1058,7 +1058,7 @@ rcsparse_token(RCSFILE *rfp, int allowed) return (0); } if (!RCSNUM_ISBRANCH(pdp->rp_value.rev)) { - rcsnum_free(pdp->rp_value.rev); + free(pdp->rp_value.rev); rcsparse_warnx(rfp, "expected branch, got \"%s\"", pdp->rp_buf); return (0); @@ -1078,7 +1078,7 @@ rcsparse_token(RCSFILE *rfp, int allowed) pdp->rp_value.rev = rcsnum_parse(pdp->rp_buf); if (pdp->rp_value.rev != NULL) { if (RCSNUM_ISBRANCH(pdp->rp_value.rev)) { - rcsnum_free(pdp->rp_value.rev); + free(pdp->rp_value.rev); rcsparse_warnx(rfp, "expected revision, got \"%s\"", pdp->rp_buf); diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c index 5f16a835c1b..d1d655887d5 100644 --- a/usr.bin/cvs/tag.c +++ b/usr.bin/cvs/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.83 2015/12/22 21:36:57 mmcc Exp $ */ +/* $OpenBSD: tag.c,v 1.84 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> * @@ -285,7 +285,7 @@ cvs_tag_check_files(struct cvs_file *cf) goto bad; rcsnum_tostr(rev, rbuf, sizeof(rbuf)); fi->crevstr = xstrdup(rbuf); - rcsnum_free(rev); + free(rev); } else if (runflags & T_DELETE) goto bad; @@ -314,8 +314,7 @@ bad: free(fi->nrevstr); free(fi->tag_new); free(fi->tag_old); - if (rev != NULL) - rcsnum_free(rev); + free(rev); free(fi); } @@ -425,11 +424,11 @@ tag_add(struct cvs_file *cf) trev = rcs_sym_getrev(cf->file_rcs, tag_name); if (trev != NULL) { if (rcsnum_cmp(srev, trev, 0) == 0) { - rcsnum_free(trev); + free(trev); return (-1); } (void)rcsnum_tostr(trev, trevbuf, sizeof(trevbuf)); - rcsnum_free(trev); + free(trev); if (!(runflags & T_FORCE_MOVE)) { cvs_printf("W %s : %s ", cf->file_path, tag_name); @@ -460,10 +459,10 @@ tag_add(struct cvs_file *cf) "failed to set tag %s to revision %s in %s", tag_name, revbuf, cf->file_rcs->rf_path); } - rcsnum_free(trev); + free(trev); return (-1); } - rcsnum_free(trev); + free(trev); return (0); } diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index fbe12aab845..2e73aa0b062 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.171 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: update.c,v 1.172 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -712,11 +712,8 @@ update_join_file(struct cvs_file *cf) update_clear_conflict(cf); out: - if (rev1 != NULL) - rcsnum_free(rev1); - if (rev2 != NULL) - rcsnum_free(rev2); - + free(rev1); + free(rev2); free(jrev1); free(jrev2); } diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index 50ac25565db..3ae2dd366e7 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.158 2015/11/05 09:48:21 nicm Exp $ */ +/* $OpenBSD: util.c,v 1.159 2016/10/13 20:51:25 fcambus Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> @@ -847,8 +847,8 @@ cvs_revision_select(RCSFILE *file, char *range) } } - rcsnum_free(lnum); - rcsnum_free(rnum); + free(lnum); + free(rnum); } cvs_argv_destroy(revargv); |