Mercurial > libpst
diff src/debug.c @ 289:cc8ee701f190
pst_block_offset elements are unsigned; consistent usage of pst_malloc and pst_realloc
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 27 May 2011 11:36:49 -0700 |
parents | 156cf548c764 |
children | 7a91e30826d8 |
line wrap: on
line diff
--- a/src/debug.c Fri May 27 09:50:24 2011 -0700 +++ b/src/debug.c Fri May 27 11:36:49 2011 -0700 @@ -164,3 +164,12 @@ return mem; } + +void *pst_realloc(void *ptr, size_t size) { + void *mem = realloc(ptr, size); + if (!mem) { + fprintf(stderr, "pst_realloc: Out Of memory [req: %ld]\n", (long)size); + exit(1); + } + return mem; +}