Am Mittwoch, 13. Juni 2007 schrieb [EMAIL PROTECTED]: > I no could tell where original function came from. It was add to > tex.c from ??? > It crash for me with free memory already free. > So this fix it. > > Also, I find that lots physfs routines that use copy, use uninit > variables, but no seem to be problem? You mean we pass variables to i.e. PhysFS which then copies something into it? This should be ok in case the PhysFS docs don't say otherwise. Personaly I initialize every var on declaration, to prevent me from forgetting it in important places and to prevent such messages from eg. valgrind, but I don't know what others think about this...
> Index: tex.c
> ===================================================================
> --- tex.c (revision 1494)
> +++ tex.c (working copy)
> @@ -264,7 +264,7 @@
>
> void iV_unloadImage(iV_Image *image)
> {
> - if (image)
> + if (image->bmp)
> {
> free(image->bmp);
> image->bmp = NULL;
The idea of this if was probably to check whether we got passed a NULL
pointer, not to check whether bmp was allready freed.
I don't know what ISO-C says, but I would guess that it is legal to call free
on a NULL pointer... Am I wrong about this?
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Warzone-dev mailing list [email protected] https://mail.gna.org/listinfo/warzone-dev
