You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2020/06/25 00:10:45 UTC
[guacamole-server] 01/01: GUACAMOLE-465: Merge remove superfluous
access check prior to attempting file deletion.
This is an automated email from the ASF dual-hosted git repository.
vnick pushed a commit to branch staging/1.2.0
in repository https://gitbox.apache.org/repos/asf/guacamole-server.git
commit 3a87dd0c968a1d171c7ec8873518a968192a114a
Merge: 9ee956f 8d90499
Author: Virtually Nick <ne...@users.noreply.github.com>
AuthorDate: Wed Jun 24 20:10:34 2020 -0400
GUACAMOLE-465: Merge remove superfluous access check prior to attempting file deletion.
src/guacenc/video.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --cc src/guacenc/video.c
index af341aa,b1ff92d..4d2bcf4
--- a/src/guacenc/video.c
+++ b/src/guacenc/video.c
@@@ -157,13 -158,20 +158,14 @@@ guacenc_video* guacenc_video_alloc(cons
return video;
/* Free all allocated data in case of failure */
-
+fail_alloc_video:
fail_output_file:
avio_close(container_format_context->pb);
- /* delete the file that was created if it was actually created */
- if (access(path, F_OK) != -1) {
- remove(path);
- }
+
+ /* Delete the file that was created if it was actually created */
+ if (unlink(path) == -1 && errno != ENOENT)
+ guacenc_log(GUAC_LOG_WARNING, "Failed output file \"%s\" could not "
+ "be automatically deleted: %s", path, strerror(errno));
fail_output_avio:
av_freep(&frame->data[0]);