Null checks for malloc() return
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
parent
4a8fac2831
commit
cb9e1f4244
|
@ -1556,6 +1556,8 @@ def _c_serialize(context, self):
|
|||
_c(' if (NULL == %s) {', aux_ptr)
|
||||
_c(' /* allocate memory */')
|
||||
_c(' %s = malloc(xcb_buffer_len);', aux_ptr)
|
||||
_c(' if (%s == NULL)', aux_ptr)
|
||||
_c(' return -1;')
|
||||
if 'serialize' == context:
|
||||
_c(' *_buffer = xcb_out;')
|
||||
_c(' }')
|
||||
|
|
Loading…
Reference in New Issue