diff --git a/lib/client/client-handshake.c b/lib/client/client-handshake.c
index 4ee88561dd2801652b303bbc0033ebf96d0daa88..7993114599727e38d43d8a751b216c9075be5a16 100644
--- a/lib/client/client-handshake.c
+++ b/lib/client/client-handshake.c
@@ -423,6 +423,7 @@ oom4:
 		goto failed1;
 	lws_remove_from_timeout_list(wsi);
 	lws_header_table_detach(wsi, 0);
+	lws_client_stash_destroy(wsi);
 	lws_free(wsi);
 
 	return NULL;