diff options
author | Neui <neuisen@googlemail.com> | 2017-06-10 08:24:34 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-10 08:24:34 +0200 |
commit | f962ba1c6cc87d7cc3506b9f4cad225f7b9d158a (patch) | |
tree | 07212487ace058ea565f84d6d87e932b462da4d9 /src/plugins/trigger | |
parent | 46b27bff4e9e604b4c882f8043f8638e30078760 (diff) | |
download | weechat-f962ba1c6cc87d7cc3506b9f4cad225f7b9d158a.zip |
trigger: if hashmap creation failed, don't use tags
If hashmap creation fails (eg. not enough memory), it jumps to the label
"end", where it checks the pointer tags, that hadn't been initialized
before.
The simple fix is to initialize it before creating the hashmap.
Diffstat (limited to 'src/plugins/trigger')
-rw-r--r-- | src/plugins/trigger/trigger-callback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index 106888832..79b2955a9 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -593,13 +593,13 @@ trigger_callback_modifier_cb (const void *pointer, void *data, TRIGGER_CALLBACK_CB_INIT(NULL); - TRIGGER_CALLBACK_CB_NEW_POINTERS; - buffer = NULL; tags = NULL; num_tags = 0; string_no_color = NULL; + TRIGGER_CALLBACK_CB_NEW_POINTERS; + /* split IRC message (if string is an IRC message) */ if ((strncmp (modifier, "irc_in_", 7) == 0) || (strncmp (modifier, "irc_in2_", 8) == 0) |