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 9b6d433..b322741 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 64bdfa5..3fb6998 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;
 }