[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: Examples: fixed logic error
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: Examples: fixed logic error |
Date: |
Fri, 25 Dec 2020 18:18:57 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 1d5efc034952f6db8fcec46987dcabe86fbd5245
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Dec 25 19:21:24 2020 +0300
Examples: fixed logic error
---
src/examples/websocket_threaded_example.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/examples/websocket_threaded_example.c
b/src/examples/websocket_threaded_example.c
index 2c1f31b3..1f4db5b8 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -714,16 +714,16 @@ run_usock (void *cls)
size = sprintf (client, "User#%d: ", (int)ws->sock);
size += got;
text = malloc (size);
- if (NULL != buf)
+ if (NULL != text)
{
sprintf (text, "%s%s", client, msg);
sent = ws_send_frame (ws->sock, text, size);
+ free (text);
}
else
{
sent = -1;
}
- free (text);
free (msg);
if (-1 == sent)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.