diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-03-12 17:17:06 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-03-12 17:17:06 -0500 |
commit | 13a0ea225fb89fe1928303faf9fa23afe355ab97 (patch) | |
tree | 14686117372277f4030b2fec20f29e54b0e864ff /dimension/parse.c | |
parent | 17f12a717ffea58b430affff4951c6527189c990 (diff) | |
download | dimension-13a0ea225fb89fe1928303faf9fa23afe355ab97.tar.xz |
Check for malloc() failures.
Diffstat (limited to 'dimension/parse.c')
-rw-r--r-- | dimension/parse.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |