<HTML><BODY><div>
<div class="js-helper js-readmsg-msg">
<div>
<div id="style_15786166291412178327_BODY">
<div class="class_1578659448">
<div>
<div>Hi!</div>

<div> </div>

<div>Thanks for your review.</div>

<div> </div>

<div>Right, fixed in v2.<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="1695069669397035559" data-timestamp="1576715520" data-type="sender">Четверг, 19 декабря 2019, 3:32 +03:00 от Vladislav Shpilevoy <<a href="/compose?To=v.shpilevoy@tarantool.org">v.shpilevoy@tarantool.org</a>>:<br>
  </span>

<div data-quote-id="1695069669397035559" 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_15767155230655664433_BODY_mailru_css_attribute_postfix">Hi! Thanks for the patch!<br>
<br>
On 13/12/2019 08:05, Ilya Kosarev wrote:
<div class="mail-quote-collapse">> 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>
> Prerequisites: #3807<br>
> ---<br>
> src/lib/salad/bps_tree.h | 2 ++<br>
> 1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/src/lib/salad/bps_tree.h b/src/lib/salad/bps_tree.h<br>
> index d28b53f53c8..51f5c8b5556 100644<br>
> --- a/src/lib/salad/bps_tree.h<br>
> +++ b/src/lib/salad/bps_tree.h<br>
> @@ -2149,6 +2149,8 @@ bps_tree_create_leaf(struct bps_tree *tree, bps_tree_block_id_t *id)<br>
> bps_tree_garbage_pop(tree, id);<br>
> if (!res)<br>
> res = (struct bps_leaf *)matras_alloc(&tree->matras, id);<br>
> + if (!res)<br>
> + return NULL;</div>
<br>
In case res was not NULL (what is 99.(9)% of all cases), you<br>
will double check it. Please, move the second check into first<br>
'if's body after matras_alloc.</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>
 

<hr>
<div> </div>

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

<div> </div>
</div>
<style type="text/css">
</style>
</BODY></HTML>