Tarantool development patches archive
 help / color / mirror / Atom feed
From: Roman Khabibov <roman.habibov@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] box: introduce constraint names hash table
Date: Wed, 13 Nov 2019 01:30:17 +0300	[thread overview]
Message-ID: <8A723C04-5B21-4EB2-859E-89088EBF38B3@tarantool.org> (raw)
In-Reply-To: <20191112141725.GC5130@uranus>

Forgot to check for NULL. I will add.

> On Nov 12, 2019, at 17:17, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> 
> On Tue, Nov 12, 2019 at 05:02:58PM +0300, Roman Khabibov wrote:
>> +
>> +int
>> +space_put_constraint_name(struct space *space, const char *name)
>> +{
>> +	uint32_t len = strlen(name);
>> +	uint32_t hash = mh_strn_hash(name, len);
>> +	char *name_copy = malloc(len);
>> +	memcpy(name_copy, name, len);
> 
> What if malloc failed here?

  reply	other threads:[~2019-11-12 22:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 14:02 [Tarantool-patches] [PATCH 0/2] Add constraint names hash table to space Roman Khabibov
2019-11-12 14:02 ` [Tarantool-patches] [PATCH 1/2] box: introduce constraint names hash table Roman Khabibov
2019-11-12 14:17   ` Cyrill Gorcunov
2019-11-12 22:30     ` Roman Khabibov [this message]
2019-11-12 23:04   ` Vladislav Shpilevoy
2019-11-12 14:02 ` [Tarantool-patches] [PATCH 2/2] sql: make constraint operations transactional Roman Khabibov
2019-11-12 23:04   ` Vladislav Shpilevoy
2019-11-12 23:04 ` [Tarantool-patches] [PATCH 0/2] Add constraint names hash table to space Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8A723C04-5B21-4EB2-859E-89088EBF38B3@tarantool.org \
    --to=roman.habibov@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] box: introduce constraint names hash table' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox