summaryrefslogtreecommitdiff
path: root/usr.bin/vi/cl
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-18 01:45:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-18 01:45:36 +0000
commit3f3eb54b6f782d4e6183148932f260c01cd66ca5 (patch)
tree6be7ec7757930503de68d781b70c9ad2ff45cb34 /usr.bin/vi/cl
parentc02c6185492d7e4e2a713bbaad986fda0049de9b (diff)
free(NULL) is ok so use it; from Michael W. Bombardieri
Diffstat (limited to 'usr.bin/vi/cl')
-rw-r--r--usr.bin/vi/cl/cl_screen.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c
index 6f75e4bc61d..c1f77ed8032 100644
--- a/usr.bin/vi/cl/cl_screen.c
+++ b/usr.bin/vi/cl/cl_screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_screen.c,v 1.27 2016/05/28 18:30:35 martijn Exp $ */
+/* $OpenBSD: cl_screen.c,v 1.28 2017/04/18 01:45:33 deraadt Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -434,14 +434,10 @@ cl_ex_init(SCR *sp)
/* Enter_standout_mode and exit_standout_mode are paired. */
if (clp->smso == NULL || clp->rmso == NULL) {
- if (clp->smso != NULL) {
- free(clp->smso);
- clp->smso = NULL;
- }
- if (clp->rmso != NULL) {
- free(clp->rmso);
- clp->rmso = NULL;
- }
+ free(clp->smso);
+ clp->smso = NULL;
+ free(clp->rmso);
+ clp->rmso = NULL;
}
/*
@@ -515,26 +511,16 @@ cl_getcap(SCR *sp, char *name, char **elementp)
static void
cl_freecap(CL_PRIVATE *clp)
{
- if (clp->el != NULL) {
- free(clp->el);
- clp->el = NULL;
- }
- if (clp->cup != NULL) {
- free(clp->cup);
- clp->cup = NULL;
- }
- if (clp->cuu1 != NULL) {
- free(clp->cuu1);
- clp->cuu1 = NULL;
- }
- if (clp->rmso != NULL) {
- free(clp->rmso);
- clp->rmso = NULL;
- }
- if (clp->smso != NULL) {
- free(clp->smso);
- clp->smso = NULL;
- }
+ free(clp->el);
+ clp->el = NULL;
+ free(clp->cup);
+ clp->cup = NULL;
+ free(clp->cuu1);
+ clp->cuu1 = NULL;
+ free(clp->rmso);
+ clp->rmso = NULL;
+ free(clp->smso);
+ clp->smso = NULL;
}
/*