From: Wolfgang Bumiller Date: Tue, 1 May 2012 13:09:17 +0000 (+0200) Subject: ast_instantiate should check return value of mem_a and return NULL on error X-Git-Tag: 0.1-rc1~535 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4c165cbd078eba262e50d69cc638b52175df926a;p=xonotic%2Fgmqcc.git ast_instantiate should check return value of mem_a and return NULL on error --- diff --git a/ast.c b/ast.c index 0fe0362..3595524 100644 --- a/ast.c +++ b/ast.c @@ -29,6 +29,9 @@ #define ast_instantiate(T, ctx, destroyfn) \ T* self = (T*)mem_a(sizeof(T)); \ + if (!self) { \ + return NULL; \ + } \ ast_node_init((ast_node*)self, ctx); \ ( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn