SAMPProjects / Open-SAMP-API

An open source API for GTA SA:MP
GNU Lesser General Public License v3.0
63 stars 15 forks source link

Clean up memory after ReadGTACmdArgument/GetServerPort calls #46

Closed marcelgerber closed 6 years ago

marcelgerber commented 6 years ago

As noted in #45. @agrippa1994

Actual fix is in f31ac13c0fcce26a9bdd0b28b30bd2b818b31f69, and then there's also some general cleanup in f3c52c2c.

marcelgerber commented 6 years ago

@agrippa1994 Any thoughts?

agrippa1994 commented 6 years ago

PR looks good! In my opinion it does not matter if we allocate 6, 7 or even 128 bytes on the heap since resources are not a problem nowadays. I would stick to more memory, just in case.

Unfortunately I can not browse the code in a convinient way at the moment but I assume that GetPlayerName handles memory that exceeds the limits properly. At least it should do it :)