From 56adc9d36197140b9158615f6760c0a9f35b05a2 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 2 May 2014 12:06:00 +0200 Subject: [PATCH] isl_id_alloc: return NULL if ctx argument is NULL We missed this in e9a49bb (isl_*alloc*: return NULL if ctx argument is NULL, Tue May 29 15:44:46 2012 +0200) because the ctx argument is used before the isl_id structure is allocation. Signed-off-by: Sven Verdoolaege --- isl_id.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/isl_id.c b/isl_id.c index 59d58189..6895570e 100644 --- a/isl_id.c +++ b/isl_id.c @@ -100,6 +100,9 @@ __isl_give isl_id *isl_id_alloc(isl_ctx *ctx, const char *name, void *user) uint32_t id_hash; struct isl_name_and_user nu = { name, user }; + if (!ctx) + return NULL; + id_hash = isl_hash_init(); if (name) id_hash = isl_hash_string(id_hash, name); -- 2.11.4.GIT