mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
tools: vsh: Don't use assert()
It's meant for testing, not for production builds. Also we have a helper for reporting OOM errors. Introduced by 23e0bf1c4eb6 Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
2c0b8d6a08
commit
eae99ca97e
@ -385,7 +385,7 @@ vshCmddefCheckInternals(vshControl *ctl,
|
||||
}
|
||||
if ((p = strchr(name, '=')) &&
|
||||
VIR_STRNDUP(name, name, p - name) < 0)
|
||||
assert(false); /* Allocation failure during self-test is bad */
|
||||
vshErrorOOM();
|
||||
for (j = i + 1; cmd->opts[j].name; j++) {
|
||||
if (STREQ(name, cmd->opts[j].name) &&
|
||||
cmd->opts[j].type != VSH_OT_ALIAS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user