Re: [PATCH 3/3] test-parse-options: --expect=<string> option to simplify tests

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

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

>> +               if (!item)
>> +                       ; /* not among entries being checked */
>> +               else {
>> +                       if (strcmp((const char *)item->util, buf.buf)) {
>> +                               printf("expected '%s', got '%s'\n",
>> +                                      (char *)item->util, buf.buf);
>> +                               *status = 1;
>> +                       }
>> +               }
>> +       }
>> +       strbuf_reset(&buf);
>
> strbuf_release ?

Thanks for spotting a leak.

I originally had the buf as static, as all generated strings are
short and of similar length, in an attempt to reuse the already
allocated storage instead of allocating it from scratch every call.

>>
>>         return 0;
>
>     return ret; ? Otherwise `ret` is unused.

This, too.  Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]