]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: vsh: Don't use assert()
authorPeter Krempa <pkrempa@redhat.com>
Tue, 12 Mar 2019 12:16:15 +0000 (13:16 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 Mar 2019 13:17:02 +0000 (14:17 +0100)
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>
tools/vsh.c

index 5e483a5d268b1acdc0878c8c6cf7c9414fcd78b9..5903f129c1630972b26caef8931d2b99c0d30df9 100644 (file)
@@ -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)