diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2009-01-23 20:47:46 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2009-01-23 20:47:46 +0000 |
commit | 86c7f44588cf49aa6e21d533a00c676a90589d1b (patch) | |
tree | ff0e6361056e385a8a5be8ffb1bf6c28106c7ee6 /app | |
parent | 5d18e05b0fbf10ae7e13d13edb5640e0e1ae6c4c (diff) |
passing a null pointer to free() is valid; sprinkle a few free->xfree.
ok oga@
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/client.c | 5 | ||||
-rw-r--r-- | app/cwm/conf.c | 21 |
2 files changed, 12 insertions, 14 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c index ffa892229..35a76149b 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: client.c,v 1.46 2009/01/22 19:01:56 okan Exp $ + * $Id: client.c,v 1.47 2009/01/23 20:47:45 okan Exp $ */ #include "headers.h" @@ -699,8 +699,7 @@ client_freehints(struct client_ctx *cc) XFree(cc->app_name); if (cc->app_class != NULL) XFree(cc->app_class); - if (cc->app_cliarg != NULL) - xfree(cc->app_cliarg); + xfree(cc->app_cliarg); } static int diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 22e660587..554748c2e 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: conf.c,v 1.55 2009/01/23 19:00:59 okan Exp $ + * $Id: conf.c,v 1.56 2009/01/23 20:47:45 okan Exp $ */ #include "headers.h" @@ -170,35 +170,34 @@ conf_clear(struct conf *c) while ((cmd = TAILQ_FIRST(&c->cmdq)) != NULL) { TAILQ_REMOVE(&c->cmdq, cmd, entry); - free(cmd); + xfree(cmd); } while ((kb = TAILQ_FIRST(&c->keybindingq)) != NULL) { TAILQ_REMOVE(&c->keybindingq, kb, entry); - free(kb); + xfree(kb); } while ((ag = TAILQ_FIRST(&c->autogroupq)) != NULL) { TAILQ_REMOVE(&c->autogroupq, ag, entry); - free(ag->class); + xfree(ag->class); if (ag->name) - free(ag->name); - free(ag->group); - free(ag); + xfree(ag->name); + xfree(ag->group); + xfree(ag); } while ((wm = TAILQ_FIRST(&c->ignoreq)) != NULL) { TAILQ_REMOVE(&c->ignoreq, wm, entry); - free(wm); + xfree(wm); } while ((mb = TAILQ_FIRST(&c->mousebindingq)) != NULL) { TAILQ_REMOVE(&c->mousebindingq, mb, entry); - free(mb); + xfree(mb); } - if (c->DefaultFontName != NULL) - free(c->DefaultFontName); + xfree(c->DefaultFontName); } void |