From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUzpe-0004Gx-TQ for qemu-devel@nongnu.org; Thu, 27 Aug 2015 12:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUzpb-0002SX-LP for qemu-devel@nongnu.org; Thu, 27 Aug 2015 12:15:18 -0400 Received: from mx2.parallels.com ([199.115.105.18]:59328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUzpb-0002SP-GG for qemu-devel@nongnu.org; Thu, 27 Aug 2015 12:15:15 -0400 References: <1440632099-5169-1-git-send-email-marcandre.lureau@redhat.com> <1440632099-5169-5-git-send-email-marcandre.lureau@redhat.com> <55DED4D6.8000508@openvz.org> <55DED5B8.7090901@openvz.org> From: "Denis V. Lunev" Message-ID: <55DF3788.9020104@parallels.com> Date: Thu, 27 Aug 2015 19:15:04 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 04/13] qga: make split_list() return allocated strings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , "Denis V. Lunev" Cc: QEMU , Michael Roth On 08/27/2015 05:30 PM, Marc-André Lureau wrote: > Hi > > On Thu, Aug 27, 2015 at 11:17 AM, Denis V. Lunev wrote: >> why not to >> __str = g_strsplit(str, delim, -1); >>>> + strv = g_strsplit(str, delim, -1); >>>> + for (i = 0; strv[i]; i++) { >>>> + list = g_list_prepend(list, strv[i]); >>>> } >>>> + g_free(strv); >> g_free(__str); >> >> This will remove all burden from callers. >> You will be able to use const char * as argument too. > > Sorry, I don't understand, could you propose a different patch? > you are right, me wrong :) I have mis-read the code. This one is perfect. Reviewed-by: Denis V. Lunev