isl_sample.c: interval_sample: avoid NULL pointer dereference
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 25 Jun 2010 16:43:01 +0000 (18:43 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:39 +0000 (17:37 +0200)
isl_sample.c

index 3564f80..8a99d7e 100644 (file)
@@ -61,6 +61,10 @@ static struct isl_vec *interval_sample(struct isl_basic_set *bset)
                return zero_sample(bset);
 
        sample = isl_vec_alloc(bset->ctx, 2);
+       if (!sample)
+               goto error;
+       if (!bset)
+               return NULL;
        isl_int_set_si(sample->block.data[0], 1);
 
        if (bset->n_eq > 0) {