From 7f56394a3cf23339c3da7586ee6da72e4f53aea7 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 14 Jun 2018 09:10:34 +0000 Subject: [PATCH] libsa: remobe unneeded check before free() free() is checking for NULL, remove duplicate check. --- stand/libsa/close.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stand/libsa/close.c b/stand/libsa/close.c index 3ea6ef16265a..d8f62fef6198 100644 --- a/stand/libsa/close.c +++ b/stand/libsa/close.c @@ -75,10 +75,9 @@ close(int fd) errno = EBADF; return (-1); } - if (f->f_rabuf != NULL) { - free(f->f_rabuf); - f->f_rabuf = NULL; - } + free(f->f_rabuf); + f->f_rabuf = NULL; + if (!(f->f_flags & F_RAW) && f->f_ops) err1 = (f->f_ops->fo_close)(f); if (!(f->f_flags & F_NODEV) && f->f_dev)