1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

fifo: replace call to malloc by weechat_asprintf

This commit is contained in:
Sébastien Helleu
2024-12-17 19:14:59 +01:00
parent e2675f5afe
commit e6409355b6
+1 -7
View File
@@ -284,13 +284,7 @@ fifo_fd_cb (const void *pointer, void *data, int fd)
ptr_buf = buffer;
if (fifo_unterminated)
{
buf2 = malloc (strlen (fifo_unterminated) +
strlen (buffer) + 1);
if (buf2)
{
strcpy (buf2, fifo_unterminated);
strcat (buf2, buffer);
}
weechat_asprintf (&buf2, "%s%s", fifo_unterminated, buffer);
ptr_buf = buf2;
free (fifo_unterminated);
fifo_unterminated = NULL;