fix for: Result of 'realloc' is converted to a pointer of type 'struct _patch *', which is incompatible with sizeof operand type 'struct _patch'