sizeof(event_handle) * (event_set->count + 1))))
RETURN_ERROR(SP_ERR_MEM, "Handle array realloc() failed");
+ event_set->handles = new_handles;
+
if (!(new_masks = realloc(event_set->masks,
- sizeof(enum sp_event) * (event_set->count + 1)))) {
- free(new_handles);
+ sizeof(enum sp_event) * (event_set->count + 1))))
RETURN_ERROR(SP_ERR_MEM, "Mask array realloc() failed");
- }
- event_set->handles = new_handles;
event_set->masks = new_masks;
((event_handle *) event_set->handles)[event_set->count] = handle;