=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/commit.c,v retrieving revision 1.122 retrieving revision 1.123 diff -c -r1.122 -r1.123 *** src/usr.bin/cvs/commit.c 2008/01/28 21:32:00 1.122 --- src/usr.bin/cvs/commit.c 2008/01/29 11:58:59 1.123 *************** *** 1,4 **** ! /* $OpenBSD: commit.c,v 1.122 2008/01/28 21:32:00 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2006 Xavier Santolaria --- 1,4 ---- ! /* $OpenBSD: commit.c,v 1.123 2008/01/29 11:58:59 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2006 Xavier Santolaria *************** *** 147,155 **** if (!(flags & CR_RECURSE_DIRS)) cvs_client_send_request("Argument -l"); ! if (logmsg != NULL) ! cvs_client_send_logmsg(logmsg); ! cvs_client_send_files(argv, argc); cvs_client_senddir("."); cvs_client_send_request("ci"); --- 147,153 ---- if (!(flags & CR_RECURSE_DIRS)) cvs_client_send_request("Argument -l"); ! cvs_client_send_logmsg(logmsg); cvs_client_send_files(argv, argc); cvs_client_senddir("."); cvs_client_send_request("ci"); *************** *** 160,165 **** --- 158,164 ---- cvs_file_freelist(&files_affected); } + xfree(logmsg); return (0); } *************** *** 170,175 **** --- 169,176 ---- RCSNUM *branch, *brev; char rev[CVS_REV_BUFSZ]; + branch = brev = NULL; + cvs_log(LP_TRACE, "cvs_commit_check_files(%s)", cf->file_path); if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) *************** *** 231,236 **** --- 232,238 ---- cvs_log(LP_ERR, "%s is not a branch revision", rev); conflicts_found++; + rcsnum_free(brev); return; } *************** *** 238,243 **** --- 240,247 ---- cvs_log(LP_ERR, "%s is not a branch revision", rev); conflicts_found++; + rcsnum_free(branch); + rcsnum_free(brev); return; } *************** *** 246,257 **** --- 250,268 ---- cvs_log(LP_ERR, "%s (%s) is not a branch", cf->file_ent->ce_tag, rev); conflicts_found++; + rcsnum_free(branch); + rcsnum_free(brev); return; } } } next: + if (branch != NULL) + rcsnum_free(branch); + if (brev != NULL) + rcsnum_free(brev); + if (cf->file_status == FILE_ADDED || cf->file_status == FILE_REMOVED || cf->file_status == FILE_MODIFIED) *************** *** 340,345 **** --- 351,357 ---- nrev = rcsnum_brtorev(brev); if (nrev == NULL) fatal("failed to create branch rev"); + rcsnum_free(brev); } else { fatal("this isnt suppose to happen, honestly"); } *************** *** 356,361 **** --- 368,375 ---- strlcpy(rbuf, "Non-existent", sizeof(rbuf)); } + if (rrev != NULL) + rcsnum_free(rrev); isnew = 0; if (cf->file_status == FILE_ADDED) { isnew = 1;