summaryrefslogtreecommitdiff
path: root/src/core/hook/hook-command-run.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-04-25 00:18:30 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-04-25 20:59:25 +0200
commite73bff95fa4bcc0902b65263bd47ec8bdc0c1128 (patch)
treed08516ff949e2b7427e8014e5424793540195bf3 /src/core/hook/hook-command-run.c
parentb56b34711dfb3bacee31265e4aa28f3c1d2a7bab (diff)
downloadweechat-e73bff95fa4bcc0902b65263bd47ec8bdc0c1128.zip
core: remove check of NULL pointers before calling free() (issue #865)
Diffstat (limited to 'src/core/hook/hook-command-run.c')
-rw-r--r--src/core/hook/hook-command-run.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/hook/hook-command-run.c b/src/core/hook/hook-command-run.c
index e664c7709..af82f3a6f 100644
--- a/src/core/hook/hook-command-run.c
+++ b/src/core/hook/hook-command-run.c
@@ -159,8 +159,7 @@ hook_command_run_exec (struct t_gui_buffer *buffer, const char *command)
hook_callback_end (ptr_hook, &hook_exec_cb);
if (rc == WEECHAT_RC_OK_EAT)
{
- if (command2)
- free (command2);
+ free (command2);
return rc;
}
}
@@ -169,8 +168,7 @@ hook_command_run_exec (struct t_gui_buffer *buffer, const char *command)
ptr_hook = next_hook;
}
- if (command2)
- free (command2);
+ free (command2);
return WEECHAT_RC_OK;
}