]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
uri_postbuf: copy the content-type, do not keep a reference to qc
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 22 Jun 2012 11:12:36 +0000 (11:12 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 23 Jul 2012 15:28:06 +0000 (17:28 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11830 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=1159caa1edf43936f2f006e713dc5cd4b2474992

prvm_cmds.c

index b3ca4bf3d98740662a6395fab88f043bb158b122..e7523057e65cc25abc281bf4ac7f00b04918add5 100644 (file)
@@ -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
        {