On 20 November 2016 at 13:59, Mun Gwan-gyeong <elong...@gmail.com> wrote: > We're missing the close() to the matching open(). > > CID 1373407 > > Signed-off-by: Mun Gwan-gyeong <elong...@gmail.com> > --- > src/util/disk_cache.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c > index 4287878..5ceb3aa 100644 > --- a/src/util/disk_cache.c > +++ b/src/util/disk_cache.c > @@ -612,19 +612,18 @@ disk_cache_put(struct disk_cache *cache, > > p_atomic_add(cache->size, size); > > - /* This close finally releases the flock, (now that the final dile > - * has been renamed into place and the size has been added). > - */ > - close(fd); > - fd = -1; > - > done: > if (filename_tmp) > ralloc_free(filename_tmp); > if (filename) > ralloc_free(filename); > + /* This close finally releases the flock, (now that the final dile > + * has been renamed into place and the size has been added). > + */ > if (fd != -1) > close(fd); > + if (fd_final != -1) > + close(fd_final); Please keep the teardown in reverse order of the setup/init. Namely:
fd_final fd filename_tmp filename -Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev