aboutsummaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2020-12-25 19:21:24 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2020-12-25 20:17:59 +0300
commit1d5efc034952f6db8fcec46987dcabe86fbd5245 (patch)
tree2ce911300603c1f707e7363e4755303d0c8e6dbf /src/examples
parent9e846e522b3aa03277ab19244d40b2dd1109f7b3 (diff)
downloadlibmicrohttpd-1d5efc034952f6db8fcec46987dcabe86fbd5245.tar.gz
libmicrohttpd-1d5efc034952f6db8fcec46987dcabe86fbd5245.zip
Examples: fixed logic error
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/websocket_threaded_example.c4
1 files 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)
714 size = sprintf (client, "User#%d: ", (int)ws->sock); 714 size = sprintf (client, "User#%d: ", (int)ws->sock);
715 size += got; 715 size += got;
716 text = malloc (size); 716 text = malloc (size);
717 if (NULL != buf) 717 if (NULL != text)
718 { 718 {
719 sprintf (text, "%s%s", client, msg); 719 sprintf (text, "%s%s", client, msg);
720 sent = ws_send_frame (ws->sock, text, size); 720 sent = ws_send_frame (ws->sock, text, size);
721 free (text);
721 } 722 }
722 else 723 else
723 { 724 {
724 sent = -1; 725 sent = -1;
725 } 726 }
726 free (text);
727 free (msg); 727 free (msg);
728 if (-1 == sent) 728 if (-1 == sent)
729 { 729 {