aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-04-22 13:07:27 +0000
committerYang Tse <yangsita@gmail.com>2008-04-22 13:07:27 +0000
commitad1dd086937138f56e5942ae0840867372c77d03 (patch)
treea9488eef5f83209b6f183e207f7e01fb7235df2c
parent95fd093c4a49aca1015e178a5c08ca9dd9234bef (diff)
fix minor memory leak triggered upon test failure
-rw-r--r--tests/server/sws.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 41bac4f01..fc4123538 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -620,7 +620,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
ssize_t written;
size_t count;
const char *buffer;
- char *ptr;
+ char *ptr=NULL;
FILE *stream;
char *cmd=NULL;
size_t cmdsize=0;
@@ -792,6 +792,10 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
if(sendfailure) {
logmsg("Sending response failed. Only (%d bytes) of (%d bytes) were sent",
responsesize-count, responsesize);
+ if(ptr)
+ free(ptr);
+ if(cmd)
+ free(cmd);
return -1;
}