=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.175 retrieving revision 1.176 diff -c -r1.175 -r1.176 *** src/usr.bin/cvs/file.c 2007/01/23 01:53:38 1.175 --- src/usr.bin/cvs/file.c 2007/01/25 18:56:33 1.176 *************** *** 1,4 **** ! /* $OpenBSD: file.c,v 1.175 2007/01/23 01:53:38 ray Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2004 Jean-Francois Brousseau --- 1,4 ---- ! /* $OpenBSD: file.c,v 1.176 2007/01/25 18:56:33 otto Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2004 Jean-Francois Brousseau *************** *** 74,84 **** int i, l; FILE *ifp; size_t len; ! char *path, *buf; - path = xmalloc(MAXPATHLEN); - buf = xmalloc(MAXNAMLEN); - TAILQ_INIT(&cvs_ign_pats); TAILQ_INIT(&dir_ign_pats); --- 74,81 ---- int i, l; FILE *ifp; size_t len; ! char path[MAXPATHLEN], buf[MAXNAMLEN]; TAILQ_INIT(&cvs_ign_pats); TAILQ_INIT(&dir_ign_pats); *************** *** 109,117 **** (void)fclose(ifp); } - - xfree(path); - xfree(buf); } void --- 106,111 ---- *************** *** 207,216 **** { int l; struct cvs_file *cf; ! char *p, *rpath; - rpath = xmalloc(MAXPATHLEN); - l = snprintf(rpath, MAXPATHLEN, "%s/%s", d, f); if (l == -1 || l >= MAXPATHLEN) fatal("cvs_file_get_cf: overflow"); --- 201,208 ---- { int l; struct cvs_file *cf; ! char *p, rpath[MAXPATHLEN]; l = snprintf(rpath, MAXPATHLEN, "%s/%s", d, f); if (l == -1 || l >= MAXPATHLEN) fatal("cvs_file_get_cf: overflow"); *************** *** 230,236 **** cf->file_status = cf->file_flags = 0; cf->file_ent = NULL; - xfree(rpath); return (cf); } --- 222,227 ---- *************** *** 241,251 **** struct stat st; struct cvs_file *cf; struct cvs_filelist *l, *nxt; ! char *d, *f, *repo, *fpath; - fpath = xmalloc(MAXPATHLEN); - repo = xmalloc(MAXPATHLEN); - for (l = TAILQ_FIRST(fl); l != NULL; l = nxt) { if (cvs_quit) fatal("received signal %d", sig_received); --- 232,239 ---- struct stat st; struct cvs_file *cf; struct cvs_filelist *l, *nxt; ! char *d, *f, repo[MAXPATHLEN], fpath[MAXPATHLEN]; for (l = TAILQ_FIRST(fl); l != NULL; l = nxt) { if (cvs_quit) fatal("received signal %d", sig_received); *************** *** 334,342 **** xfree(l->file_path); xfree(l); } - - xfree(fpath); - xfree(repo); } void --- 322,327 ---- *************** *** 355,361 **** struct cvs_ent_line *line; struct cvs_flisthead fl, dl; CVSENTRIES *entlist; ! char *buf, *ebuf, *cp, *repo, *fpath; cvs_log(LP_TRACE, "cvs_file_walkdir(%s)", cf->file_path); --- 340,346 ---- struct cvs_ent_line *line; struct cvs_flisthead fl, dl; CVSENTRIES *entlist; ! char *buf, *ebuf, *cp, repo[MAXPATHLEN], fpath[MAXPATHLEN]; cvs_log(LP_TRACE, "cvs_file_walkdir(%s)", cf->file_path); *************** *** 368,375 **** if (cf->file_status == FILE_SKIP) return; - fpath = xmalloc(MAXPATHLEN); - /* * If we do not have a admin directory inside here, dont bother, * unless we are running import. --- 353,358 ---- *************** *** 382,388 **** l = stat(fpath, &st); if (cvs_cmdop != CVS_OP_IMPORT && (l == -1 || (l == 0 && !S_ISDIR(st.st_mode)))) { - xfree(fpath); return; } --- 365,370 ---- *************** *** 544,550 **** cvs_ent_close(entlist, ENT_NOSYNC); if (cr->flags & CR_REPO) { - repo = xmalloc(MAXPATHLEN); cvs_get_repository_path(cf->file_path, repo, MAXPATHLEN); cvs_repository_lock(repo); --- 526,531 ---- *************** *** 555,570 **** cvs_file_walklist(&fl, cr); cvs_file_freelist(&fl); ! if (cr->flags & CR_REPO) { cvs_repository_unlock(repo); - xfree(repo); - } cvs_file_walklist(&dl, cr); cvs_file_freelist(&dl); - xfree(fpath); - if (cr->leavedir != NULL) cr->leavedir(cf); } --- 536,547 ---- cvs_file_walklist(&fl, cr); cvs_file_freelist(&fl); ! if (cr->flags & CR_REPO) cvs_repository_unlock(repo); cvs_file_walklist(&dl, cr); cvs_file_freelist(&dl); if (cr->leavedir != NULL) cr->leavedir(cf); } *************** *** 591,597 **** int rflags, l, ismodified, rcsdead, verbose; CVSENTRIES *entlist = NULL; const char *state; ! char *repo, *rcsfile, r1[16], r2[16]; cvs_log(LP_TRACE, "cvs_file_classify(%s)", cf->file_path); --- 568,574 ---- int rflags, l, ismodified, rcsdead, verbose; CVSENTRIES *entlist = NULL; const char *state; ! char repo[MAXPATHLEN], rcsfile[MAXPATHLEN], r1[16], r2[16]; cvs_log(LP_TRACE, "cvs_file_classify(%s)", cf->file_path); *************** *** 602,610 **** verbose = (verbosity > 1 && loud == 1); - repo = xmalloc(MAXPATHLEN); - rcsfile = xmalloc(MAXPATHLEN); - cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN); l = snprintf(rcsfile, MAXPATHLEN, "%s/%s", repo, cf->file_name); --- 579,584 ---- *************** *** 641,648 **** else cf->file_status = FILE_UNKNOWN; - xfree(repo); - xfree(rcsfile); cvs_ent_close(entlist, ENT_NOSYNC); return; } --- 615,620 ---- *************** *** 861,868 **** } } - xfree(repo); - xfree(rcsfile); cvs_ent_close(entlist, ENT_NOSYNC); } --- 833,838 ----