From 117215942185522848982f51f5fa1f2537c4f239 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 19 Dec 2007 18:34:37 +0100 Subject: Fixed crash when removing hook --- src/core/wee-hook.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index e7ac17c45..db2b3dd72 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -136,6 +136,9 @@ void hook_remove_from_list (struct t_hook *hook) { struct t_hook *new_hooks; + int type; + + type = hook->type; if (last_weechat_hook[hook->type] == hook) last_weechat_hook[hook->type] = hook->prev_hook; @@ -151,7 +154,8 @@ hook_remove_from_list (struct t_hook *hook) hook->next_hook->prev_hook = hook->prev_hook; free (hook); - weechat_hooks[hook->type] = new_hooks; + + weechat_hooks[type] = new_hooks; } /* -- cgit debian/1.2.3+git2.25.1-1-2-gaceb0