[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v3 04/34] Adapt to VIR_STRDUP and VIR_STRNDUP in src/cpu/*



On 07.05.2013 00:00, Eric Blake wrote:
> On 05/03/2013 08:53 AM, Michal Privoznik wrote:
>> ---
>>  src/cpu/cpu_generic.c |  8 ++++----
>>  src/cpu/cpu_map.c     |  3 ++-
>>  src/cpu/cpu_powerpc.c | 13 ++++++-------
>>  src/cpu/cpu_x86.c     | 10 +++++-----
>>  4 files changed, 17 insertions(+), 17 deletions(-)

> 
>> +++ b/src/cpu/cpu_powerpc.c
>> @@ -333,9 +333,8 @@ ppcDecode(virCPUDefPtr cpu,
>>          goto cleanup;
>>      }
>>  
>> -    if (!(cpu->model = strdup(model->name)) ||
>> -        (model->vendor && !(cpu->vendor = strdup(model->vendor->name)))) {
>> -        virReportOOMError();
>> +    if (VIR_STRDUP(cpu->model, model->name) < 0 ||
>> +        (model->vendor && VIR_STRDUP(cpu->vendor, model->vendor->name) < 0)) {
> 
> Another case where not requiring ATTRIBUTE_NONNNULL(2) on VIR_STRDUP
> would be handy.  I think I've convinced myself we should go that route.
>  Maybe it would help if I post a patch showing what I'm thinking?

Yep. you're completely right. However, the 1st patch is already pushed
with ATTRIBUTE_NONNULL(2). So do you want me to post a fix dropping the
useless attribute and pushing this without it, or ..,?

>

> 
> ACK.
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]