GUAC-236: Do not attempt to lock/close fd if open fails.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/1dfdcec3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/1dfdcec3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/1dfdcec3 Branch: refs/heads/master Commit: 1dfdcec34ccf097d5e3a9e16e0bb6b93a3415883 Parents: 55f5d1c Author: Michael Jumper <[email protected]> Authored: Wed Mar 16 21:52:30 2016 -0700 Committer: Michael Jumper <[email protected]> Committed: Wed Mar 16 21:52:30 2016 -0700 ---------------------------------------------------------------------- src/common/guac_recording.c | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/1dfdcec3/src/common/guac_recording.c ---------------------------------------------------------------------- diff --git a/src/common/guac_recording.c b/src/common/guac_recording.c index 461b80e..709375f 100644 --- a/src/common/guac_recording.c +++ b/src/common/guac_recording.c @@ -104,6 +104,10 @@ static int guac_common_recording_open(const char* path, } + /* Abort if we've run out of filenames */ + if (fd == -1) + return -1; + } /* end if open succeeded */ /* Lock entire output file for writing by the current process */
