diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-09-26 16:07:30 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-09-26 16:07:30 +0000 |
commit | 270598dd720114cfb5f8d54e867679aee352f32e (patch) | |
tree | d33f6bb81cb5a1288dd6a765f68574ba89839313 | |
parent | e6da30f790c446562d96711bdc6f96f707f6a585 (diff) |
can free(NULL)
-rw-r--r-- | libexec/spamd/sdl.c | 14 | ||||
-rw-r--r-- | libexec/spamd/spamd.c | 8 |
2 files changed, 7 insertions, 15 deletions
diff --git a/libexec/spamd/sdl.c b/libexec/spamd/sdl.c index 42f287c770a..f9c1a9fd0b8 100644 --- a/libexec/spamd/sdl.c +++ b/libexec/spamd/sdl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdl.c,v 1.9 2003/09/20 00:43:10 deraadt Exp $ */ +/* $OpenBSD: sdl.c,v 1.10 2003/09/26 16:07:29 deraadt Exp $ */ /* * Copyright (c) 2003 Bob Beck. All rights reserved. * @@ -253,15 +253,9 @@ sdl_lookup(struct sdlist *head, int af, void * src) static void sdl_free(struct sdlist *sdl) { - if (sdl->tag != NULL) - free(sdl->tag); - - if (sdl->string != NULL) - free(sdl->string); - - if (sdl->addrs != NULL) - free(sdl->addrs); - + free(sdl->tag); + free(sdl->string); + free(sdl->addrs); sdl_clear(sdl); } diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c index 3435a12f6d4..bfd7b1c314e 100644 --- a/libexec/spamd/spamd.c +++ b/libexec/spamd/spamd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spamd.c,v 1.47 2003/09/26 04:42:11 beck Exp $ */ +/* $OpenBSD: spamd.c,v 1.48 2003/09/26 16:07:29 deraadt Exp $ */ /* * Copyright (c) 2002 Theo de Raadt. All rights reserved. @@ -940,10 +940,8 @@ main(int argc, char *argv[]) max = MAX(max, con[i].fd); if (max > omax) { - if (fdsr) - free(fdsr); - if (fdsw) - free(fdsw); + free(fdsr); + free(fdsw); fdsr = (fd_set *)calloc(howmany(max+1, NFDBITS), sizeof(fd_mask)); if (fdsr == NULL) |