We can't say free_and_replace(exec_split[n++], quoted), because the the
argument is evaluated multiple times. But I think that this form is
still easier to read.
if (!escaped)
return log_oom();
- free(exec_split[n]);
- exec_split[n++] = TAKE_PTR(escaped);
+ free_and_replace(exec_split[n], escaped);
+ n++;
continue;
}
if (!quoted)
return log_oom();
- free(exec_split[n]);
- exec_split[n++] = TAKE_PTR(quoted);
+ free_and_replace(exec_split[n], quoted);
+ n++;
}
for (; exec_split[n]; n++)
exec_split[n] = mfree(exec_split[n]);