From: Jonathan Nieder Date: Wed, 06 Oct 2010 22:17:48 GMT Subject: Re: [PATCH 2/7] lockfile: introduce alloc_lock_file() to avoid valgrind noise Message-ID: <20101006221748.GB31818@burratino> In-Reply-To: <7vhbgzyozx.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > Jonathan Nieder writes: >> - while (lock_file_list) { >> - if (lock_file_list->owner == me && >> - lock_file_list->filename[0]) { >> - if (lock_file_list->fd >= 0) >> - close(lock_file_list->fd); >> - unlink_or_warn(lock_file_list->filename); >> - } >> - lock_file_list = lock_file_list->next; >> + while (p) { >> + if (p->owner == me && >> + p->filename[0]) { >> + if (p->fd >= 0) >> + close(p->fd); >> + unlink_or_warn(p->filename); >> + } >> + p = lock_file_list->next; >> } > > Heh, shouldn't the last one assign from p->next? Yes. And I also should have mentioned: this is untested.