=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.266 retrieving revision 1.267 diff -c -r1.266 -r1.267 *** src/usr.bin/cvs/file.c 2015/08/20 22:32:41 1.266 --- src/usr.bin/cvs/file.c 2015/11/05 09:48:21 1.267 *************** *** 1,4 **** ! /* $OpenBSD: file.c,v 1.266 2015/08/20 22:32:41 deraadt Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2004 Jean-Francois Brousseau --- 1,4 ---- ! /* $OpenBSD: file.c,v 1.267 2015/11/05 09:48:21 nicm Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2004 Jean-Francois Brousseau *************** *** 36,41 **** --- 36,42 ---- #include #include #include + #include #include #include *************** *** 375,384 **** if (l->flags & FILE_USER_SUPPLIED) { if (cmdp->cmd_flags & CVS_LOCK_REPO) cvs_repository_unlock(repo); ! if (cvs_directory_tag != NULL) { ! xfree(cvs_directory_tag); ! cvs_directory_tag = NULL; ! } } } --- 376,383 ---- if (l->flags & FILE_USER_SUPPLIED) { if (cmdp->cmd_flags & CVS_LOCK_REPO) cvs_repository_unlock(repo); ! free(cvs_directory_tag); ! cvs_directory_tag = NULL; } } *************** *** 562,572 **** fatal("cvs_file_walkdir: %s %s", cf->file_path, strerror(errno)); ! xfree(buf); while ((ip = TAILQ_FIRST(&dir_ign_pats)) != NULL) { TAILQ_REMOVE(&dir_ign_pats, ip, ip_list); ! xfree(ip); } entlist = cvs_ent_open(cf->file_path); --- 561,571 ---- fatal("cvs_file_walkdir: %s %s", cf->file_path, strerror(errno)); ! free(buf); while ((ip = TAILQ_FIRST(&dir_ign_pats)) != NULL) { TAILQ_REMOVE(&dir_ign_pats, ip, ip_list); ! free(ip); } entlist = cvs_ent_open(cf->file_path); *************** *** 613,619 **** if (cvs_directory_tag != NULL && cmdp->cmd_flags & CVS_USE_WDIR) { cvs_write_tagfile(cf->file_path, cvs_directory_tag, NULL); ! xfree(cvs_directory_tag); cvs_directory_tag = NULL; } --- 612,618 ---- if (cvs_directory_tag != NULL && cmdp->cmd_flags & CVS_USE_WDIR) { cvs_write_tagfile(cf->file_path, cvs_directory_tag, NULL); ! free(cvs_directory_tag); cvs_directory_tag = NULL; } *************** *** 632,639 **** for (f = RB_MIN(cvs_flisthead, fl); f != NULL; f = nxt) { nxt = RB_NEXT(cvs_flisthead, fl, f); RB_REMOVE(cvs_flisthead, fl, f); ! xfree(f->file_path); ! xfree(f); } } --- 631,638 ---- for (f = RB_MIN(cvs_flisthead, fl); f != NULL; f = nxt) { nxt = RB_NEXT(cvs_flisthead, fl, f); RB_REMOVE(cvs_flisthead, fl, f); ! free(f->file_path); ! free(f); } } *************** *** 754,760 **** cf->repo_fd = open(rcsfile, O_RDONLY); if (cf->repo_fd != -1) { ! xfree(cf->file_rpath); cf->file_rpath = xstrdup(rcsfile); cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, rflags); --- 753,759 ---- cf->repo_fd = open(rcsfile, O_RDONLY); if (cf->repo_fd != -1) { ! free(cf->file_rpath); cf->file_rpath = xstrdup(rcsfile); cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, rflags); *************** *** 975,988 **** void cvs_file_free(struct cvs_file *cf) { ! xfree(cf->file_name); ! xfree(cf->file_wd); ! xfree(cf->file_path); if (cf->file_rcsrev != NULL) rcsnum_free(cf->file_rcsrev); ! if (cf->file_rpath != NULL) ! xfree(cf->file_rpath); if (cf->file_ent != NULL) cvs_ent_free(cf->file_ent); if (cf->file_rcs != NULL) --- 974,986 ---- void 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_rpath); if (cf->file_ent != NULL) cvs_ent_free(cf->file_ent); if (cf->file_rcs != NULL) *************** *** 991,997 **** (void)close(cf->fd); if (cf->repo_fd != -1) (void)close(cf->repo_fd); ! xfree(cf); } int --- 989,995 ---- (void)close(cf->fd); if (cf->repo_fd != -1) (void)close(cf->repo_fd); ! free(cf); } int