summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/passwd/pwd_check.c8
-rw-r--r--usr.bin/paste/paste.c5
-rw-r--r--usr.bin/quota/quota.c5
-rw-r--r--usr.bin/rdist/client.c11
-rw-r--r--usr.bin/rusers/rusers.c5
-rw-r--r--usr.bin/telnet/commands.c14
6 files changed, 18 insertions, 30 deletions
diff --git a/usr.bin/passwd/pwd_check.c b/usr.bin/passwd/pwd_check.c
index 88f41057ac3..fcb3dfdeb41 100644
--- a/usr.bin/passwd/pwd_check.c
+++ b/usr.bin/passwd/pwd_check.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwd_check.c,v 1.14 2015/11/26 19:01:47 deraadt Exp $ */
+/* $OpenBSD: pwd_check.c,v 1.15 2015/12/09 19:39:10 mmcc Exp $ */
/*
* Copyright 2000 Niels Provos <provos@citi.umich.edu>
@@ -183,14 +183,12 @@ pwd_check(login_cap_t *lc, char *password)
/* get the return value from the child */
wait(&child);
if (WIFEXITED(child) && WEXITSTATUS(child) == 0) {
- if (checker != NULL)
- free(checker);
+ free(checker);
return (1);
}
out:
- if (checker != NULL)
- free(checker);
+ free(checker);
printf("Please use a different password. Unusual capitalization,\n");
printf("control characters, or digits are suggested.\n");
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c
index ef4c62d926b..4b00413e5bb 100644
--- a/usr.bin/paste/paste.c
+++ b/usr.bin/paste/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.21 2015/10/09 01:37:08 deraadt Exp $ */
+/* $OpenBSD: paste.c,v 1.22 2015/12/09 19:39:10 mmcc Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -212,8 +212,7 @@ sequential(char **argv)
}
if (fp != stdin)
(void)fclose(fp);
- if (lbuf)
- free(lbuf);
+ free(lbuf);
}
}
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 0e9dc68c2d3..1980c0d9965 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quota.c,v 1.36 2015/08/20 22:32:41 deraadt Exp $ */
+/* $OpenBSD: quota.c,v 1.37 2015/12/09 19:39:10 mmcc Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -477,8 +477,7 @@ getprivs(long id, int quotatype)
quptail->next = 0;
qup = NULL;
}
- if (qup)
- free(qup);
+ free(qup);
endfsent();
return (quphead);
}
diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c
index 3bf967e49a8..a4336e12f85 100644
--- a/usr.bin/rdist/client.c
+++ b/usr.bin/rdist/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.34 2015/01/21 03:18:31 guenther Exp $ */
+/* $OpenBSD: client.c,v 1.35 2015/12/09 19:39:10 mmcc Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -305,12 +305,9 @@ checkfilename(char *name)
void
freelinkinfo(struct linkbuf *lp)
{
- if (lp->pathname)
- free(lp->pathname);
- if (lp->src)
- free(lp->src);
- if (lp->target)
- free(lp->target);
+ free(lp->pathname);
+ free(lp->src);
+ free(lp->target);
free(lp);
}
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c
index 6fe6dfbf31a..33af706df8e 100644
--- a/usr.bin/rusers/rusers.c
+++ b/usr.bin/rusers/rusers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers.c,v 1.35 2015/08/20 22:32:41 deraadt Exp $ */
+/* $OpenBSD: rusers.c,v 1.36 2015/12/09 19:39:10 mmcc Exp $ */
/*
* Copyright (c) 2001, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -625,8 +625,7 @@ allhosts(void)
cleanup:
if (ifap != NULL)
freeifaddrs(ifap);
- if (fds != NULL)
- free(fds);
+ free(fds);
if (sock[0] >= 0)
(void)close(sock[0]);
if (sock[1] >= 0)
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index ff432fb723a..d289692c802 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.81 2015/11/24 05:06:24 beck Exp $ */
+/* $OpenBSD: commands.c,v 1.82 2015/12/09 19:39:10 mmcc Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -1479,10 +1479,8 @@ env_define(const char *var, const char *value)
struct env_lst *ep;
if ((ep = env_find(var))) {
- if (ep->var)
- free(ep->var);
- if (ep->value)
- free(ep->value);
+ free(ep->var);
+ free(ep->value);
} else {
if ((ep = malloc(sizeof(struct env_lst))) == NULL)
err(1, "malloc");
@@ -1510,10 +1508,8 @@ env_undefine(const char *var)
ep->prev->next = ep->next;
if (ep->next)
ep->next->prev = ep->prev;
- if (ep->var)
- free(ep->var);
- if (ep->value)
- free(ep->value);
+ free(ep->var);
+ free(ep->value);
free(ep);
}
}