=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/add.c,v retrieving revision 1.103 retrieving revision 1.104 diff -c -r1.103 -r1.104 *** src/usr.bin/cvs/add.c 2008/06/14 03:19:15 1.103 --- src/usr.bin/cvs/add.c 2008/06/14 04:34:07 1.104 *************** *** 1,4 **** ! /* $OpenBSD: add.c,v 1.103 2008/06/14 03:19:15 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2005, 2006 Xavier Santolaria --- 1,4 ---- ! /* $OpenBSD: add.c,v 1.104 2008/06/14 04:34:07 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2005, 2006 Xavier Santolaria *************** *** 335,341 **** { int added, nb, stop; char revbuf[CVS_REV_BUFSZ]; ! RCSNUM *head; char *tag; cvs_parse_tagfile(cf->file_wd, &tag, NULL, &nb); --- 335,341 ---- { int added, nb, stop; char revbuf[CVS_REV_BUFSZ]; ! RCSNUM *head = NULL; char *tag; cvs_parse_tagfile(cf->file_wd, &tag, NULL, &nb); *************** *** 346,356 **** if (cf->file_rcs != NULL) { head = rcs_head_get(cf->file_rcs); ! if (head == NULL) ! fatal("RCS head empty or missing in %s", ! cf->file_rcs->rf_path); rcsnum_tostr(head, revbuf, sizeof(revbuf)); - rcsnum_free(head); } added = stop = 0; --- 346,356 ---- if (cf->file_rcs != NULL) { head = rcs_head_get(cf->file_rcs); ! if (head == NULL) { ! cvs_log(LP_NOTICE, "no head revision in RCS file for " ! "%s", cf->file_path); ! } rcsnum_tostr(head, revbuf, sizeof(revbuf)); } added = stop = 0; *************** *** 370,381 **** add_entry(cf); /* Restore the file. */ - head = rcs_head_get(cf->file_rcs); - if (head == NULL) - fatal("RCS head empty or missing in %s", - cf->file_rcs->rf_path); cvs_checkout_file(cf, head, NULL, 0); - rcsnum_free(head); cvs_printf("U %s\n", cf->file_path); --- 370,376 ---- *************** *** 413,418 **** --- 408,416 ---- default: break; } + + if (head != NULL) + rcsnum_free(head); if (stop == 1) return;