From: Jérémie Galarneau Date: Sat, 27 May 2017 10:59:18 +0000 (-0400) Subject: Clean-up: simplify the implementation of dynamic buffer set_capacity X-Git-Tag: v2.11.0-rc1~557 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=fc804d0faf10919d60471e8b9599caad02cc7194;hp=fc804d0faf10919d60471e8b9599caad02cc7194 Clean-up: simplify the implementation of dynamic buffer set_capacity Only use realloc() to implement set_capacity's logic. In the case where buf is NULL, realloc acts like malloc() anyhow. Moreover, the memory does not need to be zeroed on allocation since size increases provide this guarantee. Signed-off-by: Jérémie Galarneau ---