summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);