use safe_malloc and safe_calloc in generated code
authorJim Meyering <meyering@redhat.com>
Thu, 2 Jul 2009 13:39:08 +0000 (15:39 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 2 Jul 2009 22:14:52 +0000 (00:14 +0200)
commit447dae7df43e8a98da59d94f1aef9895e087aa13
treeae5285a58c6297b5f2c90fc0758da9983073fe4b
parentd0bdef850e7bf0edc1a8ee1f05880cdf867aeeb6
use safe_malloc and safe_calloc in generated code

* src/generator.ml (safe_malloc): Define to guestfs_safe_malloc.
(safe_calloc): Define to guestfs_safe_calloc.
[most generated code]: Fail immediately upon failure of otherwise-
unchecked malloc and calloc calls.
* src/guestfs.c: Include <stddef.h>.
(xalloc_oversized): Define.
* src/guestfs.h (guestfs_safe_calloc): Declare.
src/generator.ml
src/guestfs.c
src/guestfs.h