[PATCH 07/10] mi: fix memory leak in miZeroLine
Peter Hutterer
peter.hutterer at who-t.net
Tue Mar 29 14:27:18 PDT 2011
On Tue, Mar 29, 2011 at 06:12:33PM +0300, Tiago Vignatti wrote:
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
> mi/mizerline.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/mi/mizerline.c b/mi/mizerline.c
> index 07cfbe1..7077b51 100644
> --- a/mi/mizerline.c
> +++ b/mi/mizerline.c
> @@ -157,9 +157,11 @@ miZeroLine(
> list_len = (height >= width) ? height : width;
> pspanInit = malloc(list_len * sizeof(DDXPointRec));
> pwidthInit = malloc(list_len * sizeof(int));
> - if (!pspanInit || !pwidthInit)
> + if (!pspanInit || !pwidthInit) {
> + free(pspanInit);
> + free(pwidthInit);
> return;
> -
> + }
> Nspans = 0;
> new_span = TRUE;
> spans = pspanInit - 1;
> --
> 1.7.0.4
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
for this series
Cheers,
Peter
More information about the xorg-devel
mailing list