diff options
-rw-r--r-- | usr.bin/mg/dired.c | 5 | ||||
-rw-r--r-- | usr.bin/mg/line.c | 5 | ||||
-rw-r--r-- | usr.bin/mg/undo.c | 8 | ||||
-rw-r--r-- | usr.bin/mg/yank.c | 5 |
4 files changed, 9 insertions, 14 deletions
diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c index b17186e8934..668bb325a2c 100644 --- a/usr.bin/mg/dired.c +++ b/usr.bin/mg/dired.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dired.c,v 1.80 2015/10/29 19:46:47 lum Exp $ */ +/* $OpenBSD: dired.c,v 1.81 2015/12/11 20:21:23 mmcc Exp $ */ /* This file is in the public domain. */ @@ -673,8 +673,7 @@ out: close(fds[1]); if (infd != -1) close(infd); - if (argv != NULL) - free(argv); + free(argv); return ret; } diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c index 50395aa164a..c63ef293f98 100644 --- a/usr.bin/mg/line.c +++ b/usr.bin/mg/line.c @@ -1,4 +1,4 @@ -/* $OpenBSD: line.c,v 1.57 2015/09/29 02:07:49 guenther Exp $ */ +/* $OpenBSD: line.c,v 1.58 2015/12/11 20:21:23 mmcc Exp $ */ /* This file is in the public domain. */ @@ -99,8 +99,7 @@ lfree(struct line *lp) } lp->l_bp->l_fp = lp->l_fp; lp->l_fp->l_bp = lp->l_bp; - if (lp->l_text != NULL) - free(lp->l_text); + free(lp->l_text); free(lp); } diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c index 246e898f1ac..62b29fd9c46 100644 --- a/usr.bin/mg/undo.c +++ b/usr.bin/mg/undo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: undo.c,v 1.56 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: undo.c,v 1.57 2015/12/11 20:21:23 mmcc Exp $ */ /* * This file is in the public domain */ @@ -115,10 +115,8 @@ free_undo_record(struct undo_rec *rec) TAILQ_INIT(&undo_free); initialised = 1; } - if (rec->content != NULL) { - free(rec->content); - rec->content = NULL; - } + free(rec->content); + rec->content = NULL; if (undo_free_num >= MAX_FREE_RECORDS) { free(rec); return; diff --git a/usr.bin/mg/yank.c b/usr.bin/mg/yank.c index 4d390120f84..ec8c3890978 100644 --- a/usr.bin/mg/yank.c +++ b/usr.bin/mg/yank.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yank.c,v 1.13 2015/03/19 21:22:15 bcallah Exp $ */ +/* $OpenBSD: yank.c,v 1.14 2015/12/11 20:21:23 mmcc Exp $ */ /* This file is in the public domain. */ @@ -87,8 +87,7 @@ kgrow(int dir) } nstart = (dir == KBACK) ? (kstart + KBLOCK) : (KBLOCK / 4); bcopy(&(kbufp[kstart]), &(nbufp[nstart]), (int)(kused - kstart)); - if (kbufp != NULL) - free(kbufp); + free(kbufp); kbufp = nbufp; ksize += KBLOCK; kused = kused - kstart + nstart; |