pcp
[Top] [All Lists]

Re: [pcp] [patch] memory leak in xfs project quotas

To: Martin Hicks <mort@xxxxxxx>
Subject: Re: [pcp] [patch] memory leak in xfs project quotas
From: Nathan Scott <nscott@xxxxxxxxxx>
Date: Thu, 7 May 2009 09:45:19 +1000 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <20090506191613.GR14353@xxxxxxxxxxxxxxxxxxxxxxxxx>
----- "Martin Hicks" <mort@xxxxxxx> wrote:

> In the linux PMDA.  Any complaints with this patch?
> 
> The changes at the beginning just get rid of whitespace annoyances.
> The last two hunks are what fix the problem.

Good catch!

> @@ -75,7 +75,7 @@ refresh_filesys_projects(pmInDom qindom, filesys_t
> *fs)
>         qp = NULL;
>         sts = pmdaCacheLookupName(qindom, p, NULL, (void **)&qp);
>         if (sts == PMDA_CACHE_ACTIVE)   /* repeated line in
> /etc/projects? */
> -           continue;
> +           goto next;
>         if (sts != PMDA_CACHE_INACTIVE) {
>             qp = (project_t *)malloc(sizeof(project_t));

This malloc return code is unchecked too - the filesys code
further on just (silently) continues on this class of error,
guess we should do the same thing here (well, "goto next" on
a NULL "qp") as SIGSEGV here would take out pmcd.

cheers.

-- 
Nathan

<Prev in Thread] Current Thread [Next in Thread>