summaryrefslogtreecommitdiff
path: root/src/plugins/fifo
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-04-24 23:19:55 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-04-25 20:59:24 +0200
commit1ae33517e92417af5e1ab05b2ed239d34d508ec1 (patch)
treee7b5e8deac4ab5974fd59f9725c73611fc93f8e0 /src/plugins/fifo
parent5ad977a6edaad81ef0379c9b7db15b31aa26ff78 (diff)
downloadweechat-1ae33517e92417af5e1ab05b2ed239d34d508ec1.zip
fifo: remove check of NULL pointers before calling free() (issue #865)
Diffstat (limited to 'src/plugins/fifo')
-rw-r--r--src/plugins/fifo/fifo.c13
1 files 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)
{