add missing fflush() on close - fixes a bug in the lock/unlock order (thx, Cyrus)
[project/uci.git] / util.c
diff --git a/util.c b/util.c
index cb88968dc3eef74766b1517e75defadebcbf1b9e..984305871ed306d4aee131b6a073f71c862c7f53 100644 (file)
--- a/util.c
+++ b/util.c
@@ -478,6 +478,7 @@ static void uci_close_stream(FILE *stream)
        if (!stream)
                return;
 
+       fflush(stream);
        fd = fileno(stream);
        flock(fd, LOCK_UN);
        fclose(stream);