[Mesa-dev] [PATCH 05/20] i965: check malloc return value in intel_resolve_map_set()

Ian Romanick idr at freedesktop.org
Wed May 14 13:00:27 PDT 2014


I'm nervous this has the same problem as patch 3.  Can you try some tests?

On 05/14/2014 10:55 AM, Juha-Pekka Heikkila wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>  src/mesa/drivers/dri/i965/intel_resolve_map.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_resolve_map.c b/src/mesa/drivers/dri/i965/intel_resolve_map.c
> index 04b5c94..c5a4cd7 100644
> --- a/src/mesa/drivers/dri/i965/intel_resolve_map.c
> +++ b/src/mesa/drivers/dri/i965/intel_resolve_map.c
> @@ -22,6 +22,7 @@
>   */
>  
>  #include "intel_resolve_map.h"
> +#include "main/imports.h"
>  
>  #include <assert.h>
>  #include <stdlib.h>
> @@ -51,6 +52,12 @@ intel_resolve_map_set(struct intel_resolve_map *head,
>     }
>  
>     *tail = malloc(sizeof(**tail));
> +
> +   if (*tail == NULL) {
> +      _mesa_error_no_memory(__func__);
> +      return;
> +   }
> +
>     (*tail)->prev = prev;
>     (*tail)->next = NULL;
>     (*tail)->level = level;
> 



More information about the mesa-dev mailing list