=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/client.c,v retrieving revision 1.49 retrieving revision 1.50 diff -c -r1.49 -r1.50 *** src/usr.bin/cvs/client.c 2007/01/18 16:45:52 1.49 --- src/usr.bin/cvs/client.c 2007/01/25 18:56:33 1.50 *************** *** 1,4 **** ! /* $OpenBSD: client.c,v 1.49 2007/01/18 16:45:52 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * --- 1,4 ---- ! /* $OpenBSD: client.c,v 1.50 2007/01/25 18:56:33 otto Exp $ */ /* * Copyright (c) 2006 Joris Vink * *************** *** 365,385 **** { struct stat st; int nb; ! char *d, *date, *fpath, *repo, *tag; d = NULL; if (lastdir != NULL && !strcmp(dir, lastdir)) return; - repo = xmalloc(MAXPATHLEN); cvs_get_repository_path(dir, repo, MAXPATHLEN); cvs_client_send_request("Directory %s\n%s", dir, repo); - xfree(repo); - - fpath = xmalloc(MAXPATHLEN); if (cvs_path_cat(dir, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_senddir: truncation"); --- 365,381 ---- { struct stat st; int nb; ! char *d, *date, fpath[MAXPATHLEN], repo[MAXPATHLEN], *tag; d = NULL; if (lastdir != NULL && !strcmp(dir, lastdir)) return; cvs_get_repository_path(dir, repo, MAXPATHLEN); cvs_client_send_request("Directory %s\n%s", dir, repo); if (cvs_path_cat(dir, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_senddir: truncation"); *************** *** 387,394 **** if (stat(fpath, &st) == 0 && (st.st_mode & (S_IRUSR|S_IRGRP|S_IROTH))) cvs_client_send_request("Static-directory"); - xfree(fpath); - d = xstrdup(dir); cvs_parse_tagfile(d, &tag, &date, &nb); --- 383,388 ---- *************** *** 619,625 **** struct cvs_ent *e; const char *errstr; struct timeval tv[2]; ! char timebuf[32], *repo, *rpath, *entry, *mode; char revbuf[32], *len, *fpath, *wdir; client_check_directory(data); --- 613,619 ---- struct cvs_ent *e; const char *errstr; struct timeval tv[2]; ! char timebuf[32], repo[MAXPATHLEN], *rpath, *entry, *mode; char revbuf[32], *len, *fpath, *wdir; client_check_directory(data); *************** *** 629,635 **** mode = cvs_remote_input(); len = cvs_remote_input(); - repo = xmalloc(MAXPATHLEN); cvs_get_repository_path(".", repo, MAXPATHLEN); STRIP_SLASH(repo); --- 623,628 ---- *************** *** 640,646 **** fpath = rpath + strlen(repo) + 1; if ((wdir = dirname(fpath)) == NULL) fatal("cvs_client_updated: dirname: %s", strerror(errno)); - xfree(repo); flen = strtonum(len, 0, INT_MAX, &errstr); if (errstr != NULL) --- 633,638 ---- *************** *** 729,735 **** cvs_client_set_static_directory(char *data) { FILE *fp; ! char *dir, *fpath; if (cvs_cmdop == CVS_OP_EXPORT) return; --- 721,727 ---- cvs_client_set_static_directory(char *data) { FILE *fp; ! char *dir, fpath[MAXPATHLEN]; if (cvs_cmdop == CVS_OP_EXPORT) return; *************** *** 739,762 **** dir = cvs_remote_input(); xfree(dir); - fpath = xmalloc(MAXPATHLEN); if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_set_static_directory: truncation"); if ((fp = fopen(fpath, "w+")) == NULL) { cvs_log(LP_ERRNO, "%s", fpath); ! goto out; } (void)fclose(fp); - out: - xfree(fpath); } void cvs_client_clear_static_directory(char *data) { ! char *dir, *fpath; if (cvs_cmdop == CVS_OP_EXPORT) return; --- 731,751 ---- dir = cvs_remote_input(); xfree(dir); if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_set_static_directory: truncation"); if ((fp = fopen(fpath, "w+")) == NULL) { cvs_log(LP_ERRNO, "%s", fpath); ! return; } (void)fclose(fp); } void cvs_client_clear_static_directory(char *data) { ! char *dir, fpath[MAXPATHLEN]; if (cvs_cmdop == CVS_OP_EXPORT) return; *************** *** 766,786 **** dir = cvs_remote_input(); xfree(dir); - fpath = xmalloc(MAXPATHLEN); if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_clear_static_directory: truncation"); (void)cvs_unlink(fpath); - - xfree(fpath); } void cvs_client_set_sticky(char *data) { FILE *fp; ! char *dir, *tag, *tagpath; if (cvs_cmdop == CVS_OP_EXPORT) return; --- 755,772 ---- dir = cvs_remote_input(); xfree(dir); if (cvs_path_cat(data, CVS_PATH_STATICENTRIES, fpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_clear_static_directory: truncation"); (void)cvs_unlink(fpath); } void cvs_client_set_sticky(char *data) { FILE *fp; ! char *dir, *tag, tagpath[MAXPATHLEN]; if (cvs_cmdop == CVS_OP_EXPORT) return; *************** *** 791,797 **** xfree(dir); tag = cvs_remote_input(); - tagpath = xmalloc(MAXPATHLEN); if (cvs_path_cat(data, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_clear_sticky: truncation"); --- 777,782 ---- *************** *** 803,816 **** (void)fprintf(fp, "%s\n", tag); (void)fclose(fp); out: - xfree(tagpath); xfree(tag); } void cvs_client_clear_sticky(char *data) { ! char *dir, *tagpath; if (cvs_cmdop == CVS_OP_EXPORT) return; --- 788,800 ---- (void)fprintf(fp, "%s\n", tag); (void)fclose(fp); out: xfree(tag); } void cvs_client_clear_sticky(char *data) { ! char *dir, tagpath[MAXPATHLEN]; if (cvs_cmdop == CVS_OP_EXPORT) return; *************** *** 820,832 **** dir = cvs_remote_input(); xfree(dir); - tagpath = xmalloc(MAXPATHLEN); if (cvs_path_cat(data, CVS_PATH_TAG, tagpath, MAXPATHLEN) >= MAXPATHLEN) fatal("cvs_client_clear_sticky: truncation"); (void)cvs_unlink(tagpath); - - xfree(tagpath); } --- 804,813 ----