Since it leaps to a creature "of your choice", you don't have to target another creature if you don't want to
The description of the green-flame blade cantrip (SCAG, p. 143; TCoE, p. 107) has somewhat similar wording to that of chaos bolt:
You brandish the weapon used in the spell’s casting and make a melee
attack with it against one creature within 5 feet of you. On a hit,
the target suffers the weapon attack’s normal effects, and you can
cause green fire to leap from the target to a different creature of
your choice that you can see within 5 feet of it. The second
creature takes fire damage equal to your spellcasting ability
modifier.
Before the 2020 errata to the Sword Coast Adventurer's Guide, the relevant line of the spell description read "[...] and green fire leaps to [...]" (which is even more similar to that of chaos bolt); the errata changed that phrase to "[...] and you can cause green fire to leap to [...]" instead.
Rules designer Jeremy Crawford stated the following about green-flame blade in an unofficial tweet from November 2015:
What does the leap effect of green-flame blade do if there are no hostile targets nearby? Does it jump to allies?
The intent is that you can choose no one. If you can't see, you can't choose anyway, and the flame halts
Given the similar wording to the description of chaos bolt (XGtE, p. 151; GGtR, p. 67), it seems safe to assume chaos bolt would work the same way, so if there are no enemies within that range of chaos bolt, you don't need to target someone else.
This is even clearer after the update to the text of green-flame blade (due to the use of "can") - but even otherwise, the specification that it leaps only to a target "of your choice" seems sufficient to indicate that you can choose no target at all. The same logic extends to chaos bolt.
This makes sense to me. Given that if the energy of chaos bolt does leap to another, you choose what creature it leaps to, it makes sense that you can use the same control over targeting to prevent it from jumping to any creature (e.g. by having it fizzle harmlessly against the ground).