Make sure a pointer to the local ures is not returned, but a
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 16 Sep 2011 07:38:17 +0000 (03:38 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 16 Sep 2011 07:38:17 +0000 (03:38 -0400)
copy instead.
CID:199
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
modules/ase/ase-interval.c

index 6c3c850..f8e2c71 100644 (file)
@@ -2044,6 +2044,12 @@ _ase_subtract_intr_union(ase_cartesian_t c, ase_interval_union_item_t u)
                u = u->next;
        }
 
+       if (na == &ures) {
+               /* Copy the local temporary to the heap */
+               na = xnew(struct ase_interval_union_item_s);
+               assert(na);
+               memcpy(na,&ures,sizeof(ures));
+       }
        return na;
 }