]> granicus.if.org Git - curl/commitdiff
On error, close "log/server.response"
authorYang Tse <yangsita@gmail.com>
Thu, 4 Oct 2007 02:09:33 +0000 (02:09 +0000)
committerYang Tse <yangsita@gmail.com>
Thu, 4 Oct 2007 02:09:33 +0000 (02:09 +0000)
tests/server/sws.c

index 65b81a4c02afdc0e949ce5cf9c64e117a41b5957..2f429edebe6410067d13778223e632ac6a8cc716 100644 (file)
@@ -711,11 +711,12 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
     /* Ok, we send no more than 200 bytes at a time, just to make sure that
        larger chunks are split up so that the client will need to do multiple
        recv() calls to get it and thus we exercise that code better */
-    int num = count;
+    size_t num = count;
     if(num > 200)
       num = 200;
     written = swrite(sock, buffer, num);
     if (written < 0) {
+      fclose(dump);
       logmsg("Sending response failed and we bailed out!");
       return -1;
     }