diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-10-11 18:01:58 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-10-11 18:01:58 +0000 |
commit | b0f78ebce3d7ad4b221373b992c99cfebdf5003a (patch) | |
tree | 1305a3ff119f5afddecf423c00a005c2ad5a5e5c /usr.bin | |
parent | fea974be69d9e666a827e2a79af6f9c597653f91 (diff) |
close the RCSFILE on error, so we don't leak memory;
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/diff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index a2eff2b513f..5b449576485 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.61 2005/10/11 14:27:27 joris Exp $ */ +/* $OpenBSD: diff.c,v 1.62 2005/10/11 18:01:57 joris Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -612,6 +612,7 @@ cvs_diff_local(CVSFILE *cf, void *arg) r1 = cf->cf_lrev; else { if ((r1 = rcsnum_parse(dap->rev1)) == NULL) { + rcs_close(rf); return (CVS_EX_DATA); } } @@ -625,6 +626,7 @@ cvs_diff_local(CVSFILE *cf, void *arg) rcsnum_tostr(r1, buf, sizeof(buf))); if (r1 != cf->cf_lrev) rcsnum_free(r1); + rcs_close(rf); return (CVS_EX_DATA); } @@ -634,6 +636,7 @@ cvs_diff_local(CVSFILE *cf, void *arg) if (dap->rev2 != NULL) { cvs_printf("retrieving revision %s\n", dap->rev2); if ((r2 = rcsnum_parse(dap->rev2)) == NULL) { + rcs_close(rf); return (CVS_EX_DATA); } b2 = rcs_getrev(rf, r2); |