[Tarantool-patches] [PATCH 1/2] box: introduce constraint names hash table

Roman Khabibov roman.habibov at tarantool.org
Wed Nov 13 01:30:17 MSK 2019


Forgot to check for NULL. I will add.

> On Nov 12, 2019, at 17:17, Cyrill Gorcunov <gorcunov at 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?



More information about the Tarantool-patches mailing list