diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-08-08 02:20:40 +0200 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2013-08-08 02:20:40 +0200 |
commit | dedcb4677b67737a781c300d06de1022201f709b (patch) | |
tree | ef5987402fc654abbaa24fce6c3e91044fb3df9b /src/hook.c | |
parent | b02d855fbdab5849db59f0edd9cc5e6038d9aae2 (diff) | |
download | ratpoison-dedcb4677b67737a781c300d06de1022201f709b.zip |
Do not leak mem if hook is already present.
From Repolho <repolho at zoho dot com>, thanks!
Diffstat (limited to 'src/hook.c')
-rw-r--r-- | src/hook.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -34,7 +34,10 @@ hook_add (struct list_head *hook, struct sbuf *s) list_for_each_entry (cur, hook, node) { if (!strcmp (sbuf_get (cur), sbuf_get (s))) - return; + { + sbuf_free (s); + return; + } } /* It's not in the list, so add it. */ |