Re: [PATCH 3/3] for-each-ref: introduce %(upstream:track[short])
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Sep 27, 2013, 14:33 UTC
- Message-ID
- <CALkWK0noW8iJWZan6EpX3Qar866AKm-HUGqWE_U9JubSmWu0yQ@mail.gmail.com>
- In-Reply-To
- <52459570.4030301@viscovery.net>
Johannes Sixt wrote:
Show 13 quoted lines
>> + else if (!num_ours) {
>> + sprintf(buf, "[behind %d]", num_theirs);
>> + v->s = xstrdup(buf);
>> + } else if (!num_theirs) {
>> + sprintf(buf, "[ahead %d]", num_ours);
>> + v->s = xstrdup(buf);
>> + } else {
>> + sprintf(buf, "[ahead %d, behind %d]",
>> + num_ours, num_theirs);
>> + v->s = xstrdup(buf);
>> + }
>
> These strdupped strings are leaked, right?Yes, there's a minor leakage; there are quite a few instances of this in the rest of the file. Do you see an easy fix?