changeset 1333:5d7b1650de1f

Fix pseudo resource leak in case another process is running. Pseudo because this code path leads to an immediate exit.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 15 Oct 2014 15:40:27 +0200
parents 8362e30f7b55
children 5c6294c201c2
files common/linuxlockfile.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/common/linuxlockfile.c	Wed Oct 15 14:19:46 2014 +0200
+++ b/common/linuxlockfile.c	Wed Oct 15 15:40:27 2014 +0200
@@ -42,6 +42,7 @@
            if (f)
              {
                bytes_read = fread(oldpid, 1, sizeof(oldpid), f);
+               fclose(f);
                if (bytes_read)
                  {
                    char *oldPath,
@@ -67,7 +68,6 @@
                        xfree(newPath);
                      }
                  }
-               fclose(f);
              }
 
            ftruncate(fd, 0);

http://wald.intevation.org/projects/trustbridge/