[PATCH xf86-video-dummy] fix a memory leak in probe

Antoine Martin antoine at nagafix.co.uk
Thu Jul 27 07:10:00 UTC 2017


Reviewed by: Antoine Martin <antoine at nagafix.co.uk>

This ptr should be freed! As per the docstrings of xf86MatchDevice:
""
  The function allocates an array of GDevPtr and
   * returns this via sectlist and returns the number of elements in
   * this list as return value.
""
And other places do the same, ie: xf86platformProbeDev



On 22/07/17 19:43, Xiaolei Yu wrote:
> 
> Signed-off-by: Xiaolei Yu <dreifachstein at gmail.com>
> ---
>  src/dummy_driver.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/dummy_driver.c b/src/dummy_driver.c
> index 2656602..5c5f00f 100644
> --- a/src/dummy_driver.c
> +++ b/src/dummy_driver.c
> @@ -263,6 +263,9 @@ DUMMYProbe(DriverPtr drv, int flags)
>  	    }
>  	}
>      }    
> +
> +    free(devSections);
> +
>      return foundScreen;
>  }
>  
> 



More information about the xorg-devel mailing list