[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15529] trunk/blender/source/blender/ blenlib/intern/util.c: Memory leak fix: br_find_exe() uses strdup() which uses malloc and therefore the returned string needs free'ing ( Found with valgrind).

Ken Hughes khughes at pacific.edu
Fri Jul 11 19:13:36 CEST 2008


This seems bad.  Shouldn't internal calls be using BLI_strdup() or 
BLI_strdupn(), so we don't have to trace back to how the original was 
allocated?

Ken

Daniel Genrich wrote:
> Revision: 15529
>           http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15529
> Author:   genscher
> Date:     2008-07-11 16:11:55 +0200 (Fri, 11 Jul 2008)
>
> Log Message:
> -----------
> Memory leak fix: br_find_exe() uses strdup() which uses malloc and therefore the returned string needs free'ing (Found with valgrind).
>
> Modified Paths:
> --------------
>     trunk/blender/source/blender/blenlib/intern/util.c
>
> Modified: trunk/blender/source/blender/blenlib/intern/util.c
> ===================================================================
> --- trunk/blender/source/blender/blenlib/intern/util.c	2008-07-11 11:10:32 UTC (rev 15528)
> +++ trunk/blender/source/blender/blenlib/intern/util.c	2008-07-11 14:11:55 UTC (rev 15529)
> @@ -1722,6 +1722,7 @@
>  	path = br_find_exe( NULL );
>  	if (path) {
>  		strcpy(fullname, path);
> +		free(path);
>  		return;
>  	}
>  #endif
>
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
>   



More information about the Bf-committers mailing list