isl_*alloc*: return NULL if ctx argument is NULL
commite9a49bbd8cc3880e41d5856a575b03d755cb7aec
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 29 May 2012 13:44:46 +0000 (29 15:44 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 23 Apr 2013 10:55:48 +0000 (23 12:55 +0200)
tree73ad682ddb793be575c0dc2e3b79371548495a54
parente61a1ea02f7bda5a16ee2a70532a959ef8ced26b
isl_*alloc*: return NULL if ctx argument is NULL

Whenever an isl function needs to perform an allocation, it calls
one of the isl_*alloc* functions on an isl_ctx obtained either from
the user or from a call to one of the *_get_ctx functions.
If this isl_ctx pointer is NULL, this means that either
the original isl_ctx_alloc failed or that the pointer on which
the *_get_ctx function was called was NULL.
In both cases, we are in an error state and we should not
allocate any more memory, but instead return as soon as possible.
We therefore return NULL from the isl_*alloc* functions,
an error condition which should already be handled by the caller.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
include/isl/ctx.h
isl_ctx.c