]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
Fix Windows-specific use-after-free causing crash after disconnecting
[xonotic/darkplaces.git] / clvm_cmds.c
index 25f3b195a32441e89ae583875990eadcbb5c44cf..eb2976804639de1230ecfe83ce99029e13350724 100644 (file)
@@ -1623,20 +1623,9 @@ static void VM_CL_setlistener (prvm_prog_t *prog)
 //#352 void(string cmdname) registercommand (EXT_CSQC)
 static void VM_CL_registercmd (prvm_prog_t *prog)
 {
-       char *t;
        VM_SAFEPARMCOUNT(1, VM_CL_registercmd);
        if(!Cmd_Exists(&cmd_client, PRVM_G_STRING(OFS_PARM0)))
-       {
-               size_t alloclen;
-
-               alloclen = strlen(PRVM_G_STRING(OFS_PARM0)) + 1;
-               t = (char *)Z_Malloc(alloclen);
-               memcpy(t, PRVM_G_STRING(OFS_PARM0), alloclen);
-               Cmd_AddCommand(&cmd_client, t, NULL, "console command created by QuakeC");
-       }
-       else
                Cmd_AddCommand(&cmd_client, PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
-
 }
 
 //#360 float() readbyte (EXT_CSQC)