[CRIU] [PATCH 1/1] simplify the asprintf() failure handling in add_fsname_auto()

Pavel Emelyanov xemul at parallels.com
Fri Apr 24 04:34:07 PDT 2015


On 04/24/2015 07:12 AM, Tycho Andersen wrote:
> On Thu, Apr 23, 2015 at 04:30:45PM +0200, Oleg Nesterov wrote:
>> Contrary to what I naively thought, the contents of fsauto_names
>> is undefined if asprintf(&fsauto_names) and this was fixed by
>> a052e0b60a33e6c94e "check return code of asprintf".
>>
>> But we can simplify this code a bit. If we rely on return value from
>> asprintf(), we can simply nullify fsauto_names on failure and avoid
>> the assymetrical "return false".
>>
>> Signed-off-by: Oleg Nesterov <oleg at redhat.com>
> 
> Whoops, sorry, just saw this. Looks good to me, I didn't check things
> very closely, I just wanted it to build again :)
> 
> Acked-by: Tycho Andersen <tycho.andersen at canonical.com>

Applied, thanks!



More information about the CRIU mailing list