<div dir="ltr">Sorry, I accidentally sent my mail to Alex instead of the list.<br><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Mario Rugiero</b> <span dir="ltr"><<a href="mailto:mrugiero@gmail.com">mrugiero@gmail.com</a>></span><br>
Date: 2013/11/26<br>Subject: Re: [Mesa-dev] [PATCH] Fixed memory leak.<br>To: Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>><br><br><br><div dir="ltr"><div><div><div>Hi, I'm an outsider (for everyone who might have not noticed), I started following the list because I'm interested in the newbie projects, too.<br>
</div>I think this free should be called regardless of new_data being null, as this doesn't imply there wasn't any in the original object.<br>
So, I believe it should be:<br><br></div>if( bufObj->Data )<br>   _mesa_align_free( bufObj->Data );<br><br></div><div>if( new_data ) {<br></div><div>   bufObj->Data = new_data;<br>...<br></div></div><div class="HOEnZb">
<div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/11/26 Alex Deucher <span dir="ltr"><<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Tue, Nov 26, 2013 at 1:22 PM, Siavash Eliasi <<a href="mailto:siavashserver@gmail.com" target="_blank">siavashserver@gmail.com</a>> wrote:<br>
<br>
In general, when you fix problems in prior patches, you should<br>
integrate the fix into the original patch(es) where the problems were,<br>
update the commit message to note what bugs were fixed and then<br>
re-send the patch set.  That prevents broken commits from getting into<br>
the git tree even if they are fixed in a later commit. You can use git<br>
rebase -i to integrate your fixes.<br>
<span><font color="#888888"><br>
Alex<br>
</font></span><div><div><br>
> ---<br>
>  src/mesa/main/bufferobj.c | 2 ++<br>
>  1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c<br>
> index 5581a5d..e68d96d 100644<br>
> --- a/src/mesa/main/bufferobj.c<br>
> +++ b/src/mesa/main/bufferobj.c<br>
> @@ -420,6 +420,8 @@ _mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,<br>
><br>
>     new_data = _mesa_align_malloc( size, ctx->Const.MinMapBufferAlignment );<br>
>     if (new_data) {<br>
> +      _mesa_align_free( bufObj->Data );<br>
> +<br>
>        bufObj->Data = (GLubyte *) new_data;<br>
>        bufObj->Size = size;<br>
>        bufObj->Usage = usage;<br>
> --<br>
> 1.8.4.2<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>
</div></div></div><br></div></div>