Reviewed-by: Samuel Iglesias Gonsálvez <sigles...@igalia.com>
On Wed, 2016-02-03 at 10:56 +0200, Juha-Pekka Heikkila wrote: > Look after calloc give memory address. > > Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikk...@gmail.com> > --- > src/compiler/glsl/ir_variable_refcount.cpp | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/compiler/glsl/ir_variable_refcount.cpp > b/src/compiler/glsl/ir_variable_refcount.cpp > index 8306be1..942ef25 100644 > --- a/src/compiler/glsl/ir_variable_refcount.cpp > +++ b/src/compiler/glsl/ir_variable_refcount.cpp > @@ -34,6 +34,7 @@ > #include "ir_variable_refcount.h" > #include "compiler/glsl_types.h" > #include "util/hash_table.h" > +#include "main/errors.h" > > ir_variable_refcount_visitor::ir_variable_refcount_visitor() > { > @@ -144,6 +145,12 @@ > ir_variable_refcount_visitor::visit_leave(ir_assignment *ir) > if (entry->referenced_count == entry->assigned_count) { > struct assignment_entry *assignment_entry = > (struct assignment_entry *)calloc(1, > sizeof(*assignment_entry)); > + > + if (!assignment_entry) { > + _mesa_error_no_memory(__func__); > + return visit_stop; > + } > + > assignment_entry->assign = ir; > entry->assign_list.push_head(&assignment_entry->link); > } _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev