From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0C4DC440F3C for ; Tue, 12 Nov 2019 17:17:27 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id j14so12965188lfb.8 for ; Tue, 12 Nov 2019 06:17:27 -0800 (PST) Date: Tue, 12 Nov 2019 17:17:25 +0300 From: Cyrill Gorcunov Message-ID: <20191112141725.GC5130@uranus> References: <49805fa2211dfa3e5d92a34a740a3f9cf488c327.1573566885.git.roman.habibov@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49805fa2211dfa3e5d92a34a740a3f9cf488c327.1573566885.git.roman.habibov@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/2] box: introduce constraint names hash table List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Khabibov Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org 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?