]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some SVQC and CSQC string leaks.
authorRudolf Polzer <divverent@xonotic.org>
Fri, 27 Nov 2015 21:19:31 +0000 (22:19 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 27 Nov 2015 21:22:25 +0000 (22:22 +0100)
qcsrc/common/util.qc
qcsrc/server/t_items.qc

index 9b6d433621066cd36349d1ae793f9ece062d3cd7..b322741f29d5a6fd60ed670cd8fff51af58452e4 100644 (file)
@@ -609,6 +609,8 @@ float cvar_settemp_restore()
                if(cvar_type(e.netname))
                {
                        cvar_set(e.netname, e.message);
+                       strunzone(e.netname);
+                       strunzone(e.message);
                        remove(e);
                        ++i;
                }
index 64bdfa552559474ece73722e02f5ee60610ed1e9..3fb6998e9ce43fd3d1640e2376bf93410591a976 100644 (file)
@@ -96,6 +96,12 @@ void Item_PreDraw()
                self.drawmask = MASK_NORMAL;
 }
 
+void ItemRemove()
+{SELFPARAM();
+       if (self.mdl)
+               strunzone(self.mdl);
+}
+
 NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
 {
     int sf = ReadByte();
@@ -242,6 +248,9 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
         if(self.ItemStatus & ITS_ANIMATE2)
             self.move_avelocity = '0 -90 0';
     }
+
+    self.entremove = ItemRemove;
+
     return true;
 }