summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2009-03-22 18:39:10 +0000
committertobias <tobias@openbsd.org>2009-03-22 18:39:10 +0000
commit0e6e2e1b91670ca2ac0e4535aad61eee3a0fb11d (patch)
tree540d2c2c6c3d61b5f2fdd0a1135c0487794b5ef8
parentDon't show rebuild status for offline volumes. (diff)
downloadwireguard-openbsd-0e6e2e1b91670ca2ac0e4535aad61eee3a0fb11d.tar.xz
wireguard-openbsd-0e6e2e1b91670ca2ac0e4535aad61eee3a0fb11d.zip
Properly free allocated memory in error case.
ok joris
-rw-r--r--usr.bin/cvs/rcs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 38c3a817217..42dd1bfa2bc 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.286 2009/02/21 19:46:40 tobias Exp $ */
+/* $OpenBSD: rcs.c,v 1.287 2009/03/22 18:39:10 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -614,12 +614,14 @@ rcs_branch_new(RCSFILE *file, RCSNUM *rev)
if (!rcsnum_cmp(sym->rs_num, brev, 0))
break;
- if (sym != NULL) {
- if (rcsnum_inc(brev) == NULL ||
- rcsnum_inc(brev) == NULL)
- return (NULL);
- } else
+ if (sym == NULL)
break;
+
+ if (rcsnum_inc(brev) == NULL ||
+ rcsnum_inc(brev) == NULL) {
+ rcsnum_free(brev);
+ return (NULL);
+ }
}
return (brev);