Re: [PATCH] Fix leaks and check for newer libraries in Kerberos related helpers

From: Markus Moeller <huaraz_at_moeller.plus.com>
Date: Sun, 15 Sep 2013 12:56:25 +0100

Hi Amos,

   Could this go into 3.4 now ? Do you have a roadmap when the helper
protocol extension will be available ?

Thank you
Markus

"Markus Moeller" wrote in message news:kvjavu$dgo$1_at_ger.gmane.org...

This should be better now.

Markus

"Alex Rousskov" <rousskov_at_measurement-factory.com> wrote in message
news:521D0B73.3090107_at_measurement-factory.com...
> On 08/26/2013 03:38 PM, Markus Moeller wrote:
>> Here is the update patch.
>
>> - if (pp && pp->next) {
>> - xfree(pp->next);
>> - pp->next = NULL;
>> - }
>> + safe_free(pp->next);
>
> This change will cause crashes on single-entry lists where pp is NULL.
>
>
>> - if (p == gdsp) {
>> - xfree(gdsp);
>> - gdsp = NULL;
>> - }
>> + safe_free(gdsp);
>> p = gdsp;
>
> This change will prevent cleanup of all entries except the very first
> one because the outer p-loop will terminate with p=gdsp making p NULL.
>
> Similar problems in another, similar part of the patch.
>
>
> You can completely remove an if-statement when using safe_free, but only
> where the if guard is the same as the one provided by safe_free:
>
> if (p) {
> xfree(p);
> p = NULL;
> }
>
> can be replaced with
>
> safe_free(p);
>
>
> However,
>
> if (something && p) {
> xfree(p);
> p = NULL;
> }
>
> can only be replaced with
>
> if (something)
> safe_free(p);
>
>
> Similarly,
>
> if (something) {
> xfree(p);
> p = NULL;
> }
>
> can only be replaced with
>
> if (something)
> safe_free(p);
>
>
> HTH,
>
> Alex.
>
>
Received on Sun Sep 15 2013 - 11:56:57 MDT

This archive was generated by hypermail 2.2.0 : Sat Sep 21 2013 - 12:00:11 MDT