diff options
author | okan | 2009-01-23 20:47:45 +0000 |
---|---|---|
committer | okan | 2009-01-23 20:47:45 +0000 |
commit | df17ce729b273d095dc5b33f6723a678c10883c1 (patch) | |
tree | 31fe6f0841c9514f1bb826b0caeac69ad2a76d00 /conf.c | |
parent | 9a0223bf3f1ff7c7e23e8c06bb2c2efc670bfe29 (diff) | |
download | cwm-df17ce729b273d095dc5b33f6723a678c10883c1.tar.gz |
passing a null pointer to free() is valid; sprinkle a few free->xfree.
ok oga@
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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 |