summaryrefslogtreecommitdiffstats
path: root/popup.c
diff options
context:
space:
mode:
authornicm <nicm>2023-06-21 06:28:18 +0000
committernicm <nicm>2023-06-21 06:28:18 +0000
commit645bf8b3ab9606bff1d94842ea14556c9f1d620a (patch)
tree35753c50dfd984b2822c781f5bd7c3b6aa637ddb /popup.c
parentbdd05bdbd3ee204d4bc7f4fad5a0bedc4ab6c254 (diff)
Check fdopen return value, from Christian Menges.
Diffstat (limited to 'popup.c')
-rw-r--r--popup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/popup.c b/popup.c
index 2195adf5..9ab8490f 100644
--- a/popup.c
+++ b/popup.c
@@ -788,6 +788,8 @@ popup_editor(struct client *c, const char *buf, size_t len,
if (fd == -1)
return (-1);
f = fdopen(fd, "w");
+ if (f == NULL)
+ return (-1);
if (fwrite(buf, len, 1, f) != 1) {
fclose(f);
return (-1);