virCommandAddArg: Don't abort on invalid input

Commit 912c6b22fc622cd7c7d29c7f8eaeb816b266daac added abort() when the
'val' parameter is NULL along with setting the error variable for the
command. We don't want to abort in this case, just set the error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2020-11-23 09:59:54 +01:00
parent a42b46dd7d
commit 6a252ab4d1

@ -1503,7 +1503,7 @@ virCommandAddArg(virCommandPtr cmd, const char *val)
if (val == NULL) {
cmd->has_error = EINVAL;
abort();
return;
}
arg = g_strdup(val);