From 13a0ea225fb89fe1928303faf9fa23afe355ab97 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 12 Mar 2010 17:17:06 -0500 Subject: Check for malloc() failures. --- dimension/parse.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dimension/parse.c') diff --git a/dimension/parse.c b/dimension/parse.c index bc57cef..7897b86 100644 --- a/dimension/parse.c +++ b/dimension/parse.c @@ -519,6 +519,8 @@ dmnsn_vector_promote(dmnsn_astnode astnode, dmnsn_symbol_table *symtable) component.type = DMNSN_AST_INTEGER; long *val = malloc(sizeof(long)); + if (!val) + dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't allocate room for integer."); *val = 0; component.ptr = val; -- cgit v1.2.3