summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-06-24 00:28:06 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-06-24 00:28:06 +0200
commit5eb2bf251f7555a3f0365a4fe1a40902e93c9c75 (patch)
tree5932180cd2faae7eb1daa4678177035a45813e03 /src
parent8f5a842412996d3d8fa573c2da000f397d530c6b (diff)
Also handle fork() failure in magick_load_image
Diffstat (limited to 'src')
-rw-r--r--src/imlib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/imlib.c b/src/imlib.c
index fb1a589..90188e1 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -312,7 +312,13 @@ static char *feh_magick_load_image(char *filename)
snprintf(argv_fd, sizeof(argv_fd), "png:fd:%d", fd);
- if ((childpid = fork()) == 0) {
+ if ((childpid = fork()) < 0) {
+ weprintf("%s: Can't load with imagemagick. Fork failed:", filename);
+ unlink(sfn);
+ free(sfn);
+ sfn = NULL;
+ }
+ else if (childpid == 0) {
/* discard convert output */
devnull = open("/dev/null", O_WRONLY);