summaryrefslogtreecommitdiff
path: root/src/network/core/packet.cpp
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2007-01-11 17:29:39 +0000
committerKUDr <kudr@openttd.org>2007-01-11 17:29:39 +0000
commit33be1ecfb1a9056b027d50d7b558cff87c5b744d (patch)
treed644a3831ca0947198b191fa3e4e8973d3a9786e /src/network/core/packet.cpp
parent91ff74641060445dc1647bbf05baeb03b45c3099 (diff)
downloadopenttd-33be1ecfb1a9056b027d50d7b558cff87c5b744d.tar.xz
(svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter
Diffstat (limited to 'src/network/core/packet.cpp')
-rw-r--r--src/network/core/packet.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp
index 38d00d8c0..511e0c675 100644
--- a/src/network/core/packet.cpp
+++ b/src/network/core/packet.cpp
@@ -26,8 +26,7 @@ extern void NORETURN CDECL error(const char *str, ...);
*/
Packet *NetworkSend_Init(const PacketType type)
{
- Packet *packet;
- MallocT(&packet, 1);
+ Packet *packet = MallocT<Packet>(1);
/* An error is inplace here, because it simply means we ran out of memory. */
if (packet == NULL) error("Failed to allocate Packet");