isl_affine_hull.c: equalities_in_underlying_set: avoid NULL pointer dereference
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 08:57:40 +0000 (10:57 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:40 +0000 (17:37 +0200)
isl_affine_hull.c

index 0e8811b..7451fed 100644 (file)
@@ -821,8 +821,11 @@ static struct isl_basic_set *equalities_in_underlying_set(
                else
                        isl_mat_free(T1);
                hull = isl_basic_set_preimage(hull, T2);
-               isl_vec_free(hull->sample);
-               hull->sample = sample;
+               if (hull) {
+                       isl_vec_free(hull->sample);
+                       hull->sample = sample;
+               } else
+                       isl_vec_free(sample);
        }
 
        return hull;