projects
/
platform
/
upstream
/
isl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93b398d
)
isl_point_alloc: avoid potential memory leak on error path
author
Sven Verdoolaege
<skimo@kotnet.org>
Sat, 19 Jun 2010 09:03:38 +0000
(11:03 +0200)
committer
Sven Verdoolaege
<skimo@kotnet.org>
Sat, 19 Jun 2010 09:03:38 +0000
(11:03 +0200)
isl_point.c
patch
|
blob
|
history
diff --git
a/isl_point.c
b/isl_point.c
index
9177c34
..
b7a7e10
100644
(file)
--- a/
isl_point.c
+++ b/
isl_point.c
@@
-13,10
+13,6
@@
__isl_give isl_point *isl_point_alloc(__isl_take isl_dim *dim,
if (!dim || !vec)
goto error;
- pnt = isl_alloc_type(dim->ctx, struct isl_point);
- if (!pnt)
- goto error;
-
if (vec->size > 1 + isl_dim_total(dim)) {
vec = isl_vec_cow(vec);
if (!vec)
@@
-24,6
+20,10
@@
__isl_give isl_point *isl_point_alloc(__isl_take isl_dim *dim,
vec->size = 1 + isl_dim_total(dim);
}
+ pnt = isl_alloc_type(dim->ctx, struct isl_point);
+ if (!pnt)
+ goto error;
+
pnt->ref = 1;
pnt->dim = dim;
pnt->vec = vec;