From 1159caa1edf43936f2f006e713dc5cd4b2474992 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 22 Jun 2012 11:12:36 +0000 Subject: [PATCH] uri_postbuf: copy the content-type, do not keep a reference to qc git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11830 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index b3ca4bf3..e7523057 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -6075,6 +6075,7 @@ typedef struct double starttime; float id; char buffer[MAX_INPUTLINE]; + char posttype[128]; unsigned char *postdata; // free when uri_to_prog_t is freed size_t postlen; char *sigdata; // free when uri_to_prog_t is freed @@ -6234,7 +6235,8 @@ void VM_uri_get (prvm_prog_t *prog) handle->sigdata[handle->siglen] = 0; } out1: - ret = Curl_Begin_ToMemory_POST(url, handle->sigdata, 0, posttype, handle->postdata, handle->postlen, (unsigned char *) handle->buffer, sizeof(handle->buffer), uri_to_string_callback, handle); + strlcpy(handle->posttype, posttype, sizeof(handle->posttype)); + ret = Curl_Begin_ToMemory_POST(url, handle->sigdata, 0, handle->posttype, handle->postdata, handle->postlen, (unsigned char *) handle->buffer, sizeof(handle->buffer), uri_to_string_callback, handle); } else { -- 2.39.2