From 1ae33517e92417af5e1ab05b2ed239d34d508ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 24 Apr 2024 23:19:55 +0200 Subject: [PATCH] fifo: remove check of NULL pointers before calling free() (issue #865) --- src/plugins/fifo/fifo.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c index d7f0daf6c..bdf06885b 100644 --- a/src/plugins/fifo/fifo.c +++ b/src/plugins/fifo/fifo.c @@ -168,11 +168,8 @@ fifo_remove () } /* remove any unterminated message */ - if (fifo_unterminated) - { - free (fifo_unterminated); - fifo_unterminated = NULL; - } + free (fifo_unterminated); + fifo_unterminated = NULL; /* remove FIFO from disk */ if (fifo_filename) @@ -260,8 +257,7 @@ fifo_exec (const char *text) weechat_command (ptr_buffer, pos_msg); free (text2); - if (command_unescaped) - free (command_unescaped); + free (command_unescaped); } /* @@ -332,8 +328,7 @@ fifo_fd_cb (const void *pointer, void *data, int fd) ptr_buf = next_ptr_buf; } - if (buf2) - free (buf2); + free (buf2); } else if (num_read < 0) {