Re: [PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration
On 10.03.2011 11:27, kei...@keithp.com wrote: Oh. You sent it to my intel email address. I'll bet exchange mangled it. I hadn't even thought to check that. kei...@keithp.com is a far better plan for useful email. Sigh. Oops. Yeah, I had actually intended to send to that address, but still somehow managed to copy-paste the intel-address from some source. I'll resend the patch to you to avoid too much handiwork demangling the mail. ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration
On Thu, 10 Mar 2011 11:07:35 +0200, Erkki Seppala wrote: > Also, I don't think it can be a CRLF-issue, because the Internet text > message format prohibits lines with CRLF and the mail isn't encoded in > any special way. (In any case, my email agent shows that all messages > have CRLF-terminated lines, and git am doesn't worry about those > files.) Oh. You sent it to my intel email address. I'll bet exchange mangled it. I hadn't even thought to check that. kei...@keithp.com is a far better plan for useful email. Sigh. -- keith.pack...@intel.com pgp5dF8iWE9vq.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration
On 10.03.2011 00:23, Keith Packard wrote: Please clean up the whitespace mistakes in this patch and resubmit. You aren't seriously editing code on Windows, are you? Hmm. I checked for the following factors: - Consistent use of spaces versus tabs compared to the old code: check - No trailing whitespace in lines: check - "git am" not complaining anything when applying to master: check Also, I don't think it can be a CRLF-issue, because the Internet text message format prohibits lines with CRLF and the mail isn't encoded in any special way. (In any case, my email agent shows that all messages have CRLF-terminated lines, and git am doesn't worry about those files.) So what did I miss? ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration
On Tue, 8 Mar 2011 03:11:50 -0800, Erkki Seppälä wrote: > There were two memory leaks in the function: one was the lack of free > for "enabled", the other was the full lack of releasing anything when > configuration was too small. The first issue was fixed by adding the > missing free, the other was addressed by replacing the duplicate > memory releasing sequences with one that is gotoed into. Please clean up the whitespace mistakes in this patch and resubmit. You aren't seriously editing code on Windows, are you? -- keith.pack...@intel.com pgpM4QDGhBFTm.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] xfree86/modes: Fixed memory leak in xf86InitialConfiguration
On Tue, Mar 08, 2011 at 01:11:50PM +0200, Erkki Seppälä wrote: > There were two memory leaks in the function: one was the lack of free > for "enabled", the other was the full lack of releasing anything when > configuration was too small. The first issue was fixed by adding the > missing free, the other was addressed by replacing the duplicate > memory releasing sequences with one that is gotoed into. > > Reviewed-by: Rami Ylimäki > Signed-off-by: Erkki Seppälä Reviewed-by: Peter Hutterer Cheers, Peter > --- > hw/xfree86/modes/xf86Crtc.c | 21 - > 1 files changed, 8 insertions(+), 13 deletions(-) > > diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c > index 9a5e50a..7eaecdb 100644 > --- a/hw/xfree86/modes/xf86Crtc.c > +++ b/hw/xfree86/modes/xf86Crtc.c > @@ -2353,6 +2353,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool > canGrow) > int i = scrn->scrnIndex; > Bool have_outputs = TRUE; > Bool ret; > +Bool success = FALSE; > > /* Set up the device options */ > config->options = xnfalloc (sizeof (xf86DeviceOptions)); > @@ -2411,11 +2412,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool > canGrow) > * Set the position of each output > */ > if (!xf86InitialOutputPositions (scrn, modes)) > -{ > - free(crtcs); > - free(modes); > - return FALSE; > -} > + goto bailout; > > /* > * Set initial panning of each output > @@ -2426,11 +2423,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool > canGrow) > * Assign CRTCs to fit output configuration > */ > if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, > height)) > -{ > - free(crtcs); > - free(modes); > - return FALSE; > -} > + goto bailout; > > /* XXX override xf86 common frame computation code */ > > @@ -2507,7 +2500,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool > canGrow) > * Make sure the configuration isn't too small. > */ > if (width < config->minWidth || height < config->minHeight) > - return FALSE; > + goto bailout; > > /* > * Limit the crtc config to virtual[XY] if the driver can't grow the > @@ -2530,10 +2523,12 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool > canGrow) > xf86CVTMode(width, height, 60, 0, 0)); > } > > - > +success = TRUE; > + bailout: > free(crtcs); > free(modes); > -return TRUE; > +free(enabled); > +return success; > } > > /* > -- > 1.7.0.4 > > ___ > xorg-devel@lists.x.org: X.Org development > Archives: http://lists.x.org/archives/xorg-devel > Info: http://lists.x.org/mailman/listinfo/xorg-devel > ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel