summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/buf.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-11-02 16:45:22 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-11-02 16:45:22 +0000
commitc12b963ede4ecd36859344cfa5830c1426a7700e (patch)
tree01f6075b31445858757848dbaa5cbb7f22051294 /usr.bin/rcs/buf.c
parent668039031ddbfe6ffa2120b2ff6854a69293099c (diff)
Allow rcsnum_free and buf_free to accept NULL and remove various NULL
checks that are now unnecessary, from Michael W Bombardieri. ok millert
Diffstat (limited to 'usr.bin/rcs/buf.c')
-rw-r--r--usr.bin/rcs/buf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/rcs/buf.c b/usr.bin/rcs/buf.c
index 7c7931567d9..24d9427862b 100644
--- a/usr.bin/rcs/buf.c
+++ b/usr.bin/rcs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.25 2015/06/13 20:15:21 nicm Exp $ */
+/* $OpenBSD: buf.c,v 1.26 2015/11/02 16:45:21 nicm Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -138,6 +138,8 @@ out:
void
buf_free(BUF *b)
{
+ if (b == NULL)
+ return;
free(b->cb_buf);
free(b);
}