[quake3-commits] r1225 - trunk/code/botlib
Ludwig Nussel
ludwig.nussel at suse.de
Sun Dec 2 09:34:26 EST 2007
> Author: tma
> Date: 2007-12-02 08:30:12 -0500 (Sun, 02 Dec 2007)
> New Revision: 1225
>
> Modified:
> trunk/code/botlib/l_libvar.c
> trunk/code/botlib/l_precomp.c
> Log:
> * Make some botlib memory allocations /potentially/ safer
>
>
> Modified: trunk/code/botlib/l_libvar.c
> ===================================================================
> --- trunk/code/botlib/l_libvar.c 2007-12-02 00:48:59 UTC (rev 1224)
> +++ trunk/code/botlib/l_libvar.c 2007-12-02 13:30:12 UTC (rev 1225)
> @@ -84,9 +84,9 @@
> {
> libvar_t *v;
>
> - v = (libvar_t *) GetMemory(sizeof(libvar_t) + strlen(var_name) + 1);
> + v = (libvar_t *) GetMemory(sizeof(libvar_t));
> Com_Memset(v, 0, sizeof(libvar_t));
> - v->name = (char *) v + sizeof(libvar_t);
> + v->name = (char *) GetMemory(strlen(var_name)+1);
I don't see the benefit of this change. The only difference is additional
overhead for the meta data.
cu
Ludwig
--
(o_ Ludwig Nussel
//\ SUSE LINUX Products GmbH, Development
V_/_ http://www.suse.de/
More information about the quake3
mailing list