diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-08-25 20:50:07 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-08-25 20:50:07 +0300 |
commit | 09c4a22975cf02c77c8326e5fdf26a90fa61b5c7 (patch) | |
tree | 16834d27465d1d7e40867a6d3da09ae807388ad5 | |
parent | 46c0d3f4704b138ca279881c8cb222feb77989c6 (diff) | |
download | libmicrohttpd-09c4a22975cf02c77c8326e5fdf26a90fa61b5c7.tar.gz libmicrohttpd-09c4a22975cf02c77c8326e5fdf26a90fa61b5c7.zip |
websocket_threaded_example: fix static analyzer error
-rw-r--r-- | src/examples/websocket_threaded_example.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c index 1502501b..cfb7d750 100644 --- a/src/examples/websocket_threaded_example.c +++ b/src/examples/websocket_threaded_example.c | |||
@@ -495,7 +495,11 @@ ws_get_accept_value (const char *key, char **val) | |||
495 | strncpy (str + WS_KEY_LEN, WS_GUID, WS_GUID_LEN + 1); | 495 | strncpy (str + WS_KEY_LEN, WS_GUID, WS_GUID_LEN + 1); |
496 | SHA1Reset (&ctx); | 496 | SHA1Reset (&ctx); |
497 | SHA1Input (&ctx, (const unsigned char *) str, WS_KEY_GUID_LEN); | 497 | SHA1Input (&ctx, (const unsigned char *) str, WS_KEY_GUID_LEN); |
498 | SHA1Result (&ctx, hash); | 498 | if (SHA1_RESULT_SUCCESS != SHA1Result (&ctx, hash)) |
499 | { | ||
500 | free (str); | ||
501 | return MHD_NO; | ||
502 | } | ||
499 | free (str); | 503 | free (str); |
500 | len = BASE64Encode (hash, SHA1HashSize, val); | 504 | len = BASE64Encode (hash, SHA1HashSize, val); |
501 | if (-1 == len) | 505 | if (-1 == len) |