diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-01-29 12:00:35 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-01-29 12:00:35 +0000 |
commit | 45bf4d2fc3c8f701b451f221fe69898faa5e9bc3 (patch) | |
tree | 86ac4dff630232d23af70e765d7e8e12b860fb3a /usr.bin/cvs | |
parent | 71f91eb3ec5f8077e005940b677da4337fe31c3d (diff) |
Properly free dynamically allocated memory on error path.
> Diff from Igor Zinovik
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/diff.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index 00392a367d3..dcbf6aa5b21 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.122 2008/01/28 20:31:07 tobias Exp $ */ +/* $OpenBSD: diff.c,v 1.123 2008/01/29 12:00:34 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -202,8 +202,11 @@ cvs_diff_local(struct cvs_file *cf) return; if (rev2 != NULL) - if ((diff_rev2 = rcs_translate_tag(rev2, cf->file_rcs)) == NULL) + if ((diff_rev2 = rcs_translate_tag(rev2, cf->file_rcs)) == + NULL) { + rcsnum_free(diff_rev1); return; + } diff_file = cf->file_path; cvs_printf("Index: %s\n%s\nRCS file: %s\n", cf->file_path, |