diff --git a/mongoose.c b/mongoose.c
index 1dbe859f55d52bc1121de33a25741b1ef6c2b43f..dd894b0370883393bd3938df6eab78fda664e127 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -1672,7 +1672,7 @@ static void *push_to_stdin(void *arg) {
 
 static void *pull_from_stdout(void *arg) {
   struct threadparam *tp = (struct threadparam *)arg;
-  int k, stop = 0;
+  int k = 0, stop = 0;
   DWORD n, sent;
   char buf[IOBUF_SIZE];