summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontends/monkey/browser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/monkey/browser.c b/frontends/monkey/browser.c
index 232f33ed3..a00dcb48b 100644
--- a/frontends/monkey/browser.c
+++ b/frontends/monkey/browser.c
@@ -594,6 +594,10 @@ monkey_window_handle_exec(int argc, char **argv)
total += strlen(argv[i]) + 1;
}
char *cmd = calloc(total, 1);
+ if (cmd == NULL) {
+ moutf(MOUT_ERROR, "JS WIN %d RET ENOMEM", atoi(argv[2]));
+ return;
+ }
strcpy(cmd, argv[4]);
for (int i = 5; i < argc; ++i) {
strcat(cmd, " ");