Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
entry = isl_hash_table_find(ctx, &hmap->table, hash, &has_key, key, 1);
if (!entry)
- return -1;
+ goto error;
if (entry->data) {
pair = entry->data;
}
pair = isl_alloc_type(ctx, struct isl_map_basic_set_pair);
- if (!pair) {
- isl_map_free(key);
- isl_basic_set_free(val);
- return -1;
- }
+ if (!pair)
+ goto error;
entry->data = pair;
pair->key = key;
pair->val = val;
return 0;
+error:
+ isl_map_free(key);
+ isl_basic_set_free(val);
+ return -1;
}