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 (from parent 1:
c1f805b
)
isl_tab_pip.c: sol_map_init: avoid NULL pointer dereference
author
Sven Verdoolaege
<skimo@kotnet.org>
Fri, 25 Jun 2010 18:55:12 +0000
(20:55 +0200)
committer
Sven Verdoolaege
<skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:39 +0000
(17:37 +0200)
isl_tab_pip.c
patch
|
blob
|
history
diff --git
a/isl_tab_pip.c
b/isl_tab_pip.c
index
b616a33
..
41319fe
100644
(file)
--- a/
isl_tab_pip.c
+++ b/
isl_tab_pip.c
@@
-505,6
+505,8
@@
struct isl_sol_map {
static void sol_map_free(struct isl_sol_map *sol_map)
{
static void sol_map_free(struct isl_sol_map *sol_map)
{
+ if (!sol_map)
+ return;
if (sol_map->sol.context)
sol_map->sol.context->op->free(sol_map->sol.context);
isl_map_free(sol_map->map);
if (sol_map->sol.context)
sol_map->sol.context->op->free(sol_map->sol.context);
isl_map_free(sol_map->map);
@@
-3210,7
+3212,10
@@
static struct isl_context *isl_context_alloc(struct isl_basic_set *dom)
static struct isl_sol_map *sol_map_init(struct isl_basic_map *bmap,
struct isl_basic_set *dom, int track_empty, int max)
{
static struct isl_sol_map *sol_map_init(struct isl_basic_map *bmap,
struct isl_basic_set *dom, int track_empty, int max)
{
- struct isl_sol_map *sol_map;
+ struct isl_sol_map *sol_map = NULL;
+
+ if (!bmap)
+ goto error;
sol_map = isl_calloc_type(bmap->ctx, struct isl_sol_map);
if (!sol_map)
sol_map = isl_calloc_type(bmap->ctx, struct isl_sol_map);
if (!sol_map)