diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2010-04-27 23:28:10 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2010-04-27 23:28:10 -0400 |
commit | c165f25410f817d248ad5d07e1827d33efd1b0a0 (patch) | |
tree | cef228bad2c8491880882941644a0ab1d3692d4a | |
parent | caff7db93d205e32a535d49e51a3cad70f91dfdd (diff) |
[object] Actually handle malloc() failure
Caught by John Daggett.
-rw-r--r-- | src/hb-object-private.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/hb-object-private.h b/src/hb-object-private.h index 610ae68..163c5c1 100644 --- a/src/hb-object-private.h +++ b/src/hb-object-private.h @@ -83,10 +83,12 @@ typedef struct { #define HB_OBJECT_DO_CREATE(Type, obj) \ HB_LIKELY (( \ - (obj) = (Type *) calloc (1, sizeof (Type)), \ - HB_OBJECT_DO_INIT_EXPR (obj), \ - HB_OBJECT_DEBUG_OUT (obj), \ - (obj) \ + ( \ + ((obj) = (Type *) calloc (1, sizeof (Type))) && \ + HB_OBJECT_DO_INIT_EXPR (obj) && \ + HB_OBJECT_DEBUG_OUT (obj) \ + ), \ + (obj) \ )) #define HB_OBJECT_DO_REFERENCE(obj) \ |