e8fa8b
diff -ruNp a/src/run-as-child.c b/src/run-as-child.c
e8fa8b
--- a/src/run-as-child.c	2021-10-14 08:17:04.556107815 +0200
e8fa8b
+++ b/src/run-as-child.c	2021-10-14 08:36:23.686706344 +0200
e8fa8b
@@ -98,8 +98,14 @@ int exec_as_func(int flags, void *ptr)
e8fa8b
 			/* Create single string with all command line options. */
e8fa8b
 			int ii = 1;
e8fa8b
 			char *opt = strdup(":");
e8fa8b
+            char *tempOpt;
e8fa8b
 			while (opt != NULL && arg[ii] != NULL) {
e8fa8b
-				opt = realloc(opt, strlen(opt) + strlen(arg[ii]) + 2);
e8fa8b
+				tempOpt = realloc(opt, strlen(opt) + strlen(arg[ii]) + 2);
e8fa8b
+                if (tempOpt != NULL){
e8fa8b
+                    opt = tempOpt;
e8fa8b
+                } else {
e8fa8b
+                    break;
e8fa8b
+                }
e8fa8b
 				opt = strcat(opt, " ");
e8fa8b
 				opt = strcat(opt, arg[ii]);
e8fa8b
 				ii++;