From 4c165cbd078eba262e50d69cc638b52175df926a Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 1 May 2012 15:09:17 +0200 Subject: [PATCH 1/1] ast_instantiate should check return value of mem_a and return NULL on error --- ast.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.2