The cavity in your tree may have developed after the bark was damaged by a lawnmower or line cutter. Unfortunately, there is no chemical treatment that will kill wood rot fungi in a live tree.
It is difficult to predict when a tree with a cavity in its trunk will fall. You should have a professional arborist inspect the tree and determine its potential hazard to people and nearby structures. You can find arborists and tree care companies listed in the phone book yellow pages and on websites of the following organizations:
By V. Lazaneo, Urban Horticulture Advisor, Emeritus, UC Cooperative Extension, September 2012
To locate a certified arborist call companies listed under "Tree Service" in the yellow pages phone directory. You can also obtain a referral from the International Society of Arboriculture or from the San Diego County Professional Tree Care Assoc. (619) 443 6202.
You should prevent honeybees from building a nest in the cavity, if the tree is not removed. If Africanized honeybees nest in the cavity, the colony will be a hazard to people and pets in the area. You can bee-proof the cavity by filling it with expanding polyurethane foam, sold at home improvement stores. Covering the cavity entrance with one-eighth inch mesh hardware cloth will also exclude bees.
A tree that has a cavity in its trunk may continue to live for several years. Wood rot fungi destroy non-living wood inside the trunk, but do not kill the live tissue in the outer part of the trunk. There is no chemical treatment or other way to kill wood rot fungi inside a tree's trunk. The outer layer of wood in a tree's trunk provides most of its strength, but the trunk will become weaker as the size of the cavity increases.