<HTML><BODY><div>
<div class="js-helper js-readmsg-msg">
<style type="text/css">
</style>
<div>
<div id="style_15795430490842073938_BODY">
<div class="class_1579546724">
<div>
<div>Hi!</div>

<div> </div>

<div>Thanks for the review. Remarks fixed in v3.<br>
 </div>

<div class="mail-quote-collapse">
<blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px;"><span data-email="v.shpilevoy@tarantool.org" data-name="Vladislav Shpilevoy" data-quote-id="1696021850923477963" data-timestamp="1579035600" data-type="sender">Среда, 15 января 2020, 0:00 +03:00 от Vladislav Shpilevoy <<a href="/compose?To=v.shpilevoy@tarantool.org">v.shpilevoy@tarantool.org</a>>:<br>
  </span>

<div data-quote-id="1696021850923477963" data-type="body">
<div id="">
<div class="js-helper_mailru_css_attribute_postfix js-readmsg-msg_mailru_css_attribute_postfix">
<style type="text/css">
</style>
<div>
<div id="style_15790356281473111233_BODY_mailru_css_attribute_postfix">Hi! Thanks for the patch!<br>
<br>
On 13/01/2020 22:31, Ilya Kosarev wrote:<br>
> In bps_tree_create_leaf we use matras_alloc in case<br>
> bps_tree_garbage_pop didn't work out. However it also might not<br>
> succeed. Then we need to return NULL instead of dereferencing NULL<br>
> pointer.<br>
><br>
> Part of: #3807<br>
<br>
Please, drop ':', we don't use it when reference tickets.<br>
<br>
> ---<br>
> src/lib/salad/bps_tree.h | 7 +++++--<br>
> 1 file changed, 5 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/lib/salad/bps_tree.h b/src/lib/salad/bps_tree.h<br>
> index d28b53f53..ede2a3b7f 100644<br>
> --- a/src/lib/salad/bps_tree.h<br>
> +++ b/src/lib/salad/bps_tree.h<br>
> @@ -2147,8 +2147,11 @@ bps_tree_create_leaf(struct bps_tree *tree, bps_tree_block_id_t *id)<br>
> {<br>
> struct bps_leaf *res = (struct bps_leaf *)<br>
> bps_tree_garbage_pop(tree, id);<br>
> - if (!res)<br>
> - res = (struct bps_leaf *)matras_alloc(&tree->matras, id);<br>
> + if (!res) {<br>
> + res = (struct bps_leaf *) matras_alloc(&tree->matras, id);<br>
> + if (!res)<br>
> + return NULL;<br>
> + }<br>
<br>
Since you've changed this code anyway, lets use explicit<br>
'== NULL' instead of '!'.</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>

<div data-signature-widget="container">
<div data-signature-widget="content">
<div>--<br>
Ilya Kosarev</div>
</div>
</div>

<div> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</BODY></HTML>