X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fdynamic-buffer.c;h=cec2f1e608a67d1e0a148c491c8a8015ce5f27dc;hb=e9347dad290bd17c81846a6c9dda6e9bc05ead5b;hp=2e27afa1f92f446c12de25a0f268f6de33623536;hpb=15e376636cbda79bdd8a71d0a1bec892d9997738;p=lttng-tools.git diff --git a/src/common/dynamic-buffer.c b/src/common/dynamic-buffer.c index 2e27afa1f..cec2f1e60 100644 --- a/src/common/dynamic-buffer.c +++ b/src/common/dynamic-buffer.c @@ -148,7 +148,8 @@ int lttng_dynamic_buffer_set_capacity(struct lttng_dynamic_buffer *buffer, { int ret = 0; void *new_buf; - size_t new_capacity = round_to_power_of_2(demanded_capacity); + size_t new_capacity = demanded_capacity ? + round_to_power_of_2(demanded_capacity) : 0; if (!buffer || demanded_capacity < buffer->size) { /*