[mw-devel] MW3 r1120 - branches/nomud/src
welshbyte at sucs.org
welshbyte at sucs.org
Tue Dec 8 16:31:38 GMT 2009
Author: welshbyte
Date: 2009-12-08 16:31:38 +0000 (Tue, 08 Dec 2009)
New Revision: 1120
Modified:
branches/nomud/src/rooms.c
Log:
Fix some memory leaks
Modified: branches/nomud/src/rooms.c
===================================================================
--- branches/nomud/src/rooms.c 2009-12-07 17:58:16 UTC (rev 1119)
+++ branches/nomud/src/rooms.c 2009-12-08 16:31:38 UTC (rev 1120)
@@ -81,12 +81,22 @@
room->name = db_room_get(num, "name");
room->desc = db_room_get(num, "desc");
room->prompt = db_room_get(num, "prompt");
+
tmp = db_room_get(num, "hidden");
- if (tmp) room->hidden = atoi(tmp);
+ if (tmp) {
+ room->hidden = atoi(tmp);
+ free(tmp);
+ }
tmp = db_room_get(num, "soundproof");
- if (tmp) room->sproof = atoi(tmp);
+ if (tmp) {
+ room->sproof = atoi(tmp);
+ free(tmp);
+ }
tmp = db_room_get(num, "locked");
- if (tmp) room->locked = atoi(tmp);
+ if (tmp) {
+ room->locked = atoi(tmp);
+ free(tmp);
+ }
return 1;
}
More information about the mw-devel
mailing list