summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-12-04 09:46:28 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-12-04 09:46:28 +0000
commitd348db3b021a59a09b3d18a071e2369e22743e16 (patch)
tree941f71b27cf994bfe3fc7ed03306bea9293b7ad1 /usr.bin/cvs
parentbc8d5124c0df4e7b4893c54d00bbf7e7c6208c27 (diff)
- unlink tmp files when finished.
- add missing xfree().
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/import.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c
index 76d1ee4b5a6..1e2b7d83ead 100644
--- a/usr.bin/cvs/import.c
+++ b/usr.bin/cvs/import.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: import.c,v 1.54 2006/07/08 09:25:44 ray Exp $ */
+/* $OpenBSD: import.c,v 1.55 2006/12/04 09:46:27 xsa Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -354,9 +354,25 @@ import_get_rcsdiff(struct cvs_file *cf, RCSNUM *rev)
diff_format = D_RCSDIFF;
if (cvs_diffreg(p2, p1, b3) == D_ERROR)
fatal("import_get_rcsdiff: failed to get RCS patch");
+
+ (void)unlink(p1);
+ (void)unlink(p2);
+
+ if (p1 != NULL)
+ xfree(p1);
+ if (p2 != NULL)
+ xfree(p2);
}
cvs_buf_putc(b3, '\0');
delta = cvs_buf_release(b3);
+
+ if (b1 != NULL)
+ cvs_buf_free(b1);
+ if (b2 != NULL)
+ cvs_buf_free(b2);
+ if (b3 != NULL)
+ cvs_buf_free(b3);
+
return (delta);
}