Why does the OP think his life is meaningless? If you can change just one life for the better it's not meaningless. Think about it. Logically, nothing should exist. Yet, here we are, and you can read this reply. So that is proof that there's a definite meaning to this life, your life, my life and all life. But, if you think bad thoughts, when you "die" your "essence" which makes the OP the OP will get all confused, and take many many more life times before you become intelligent enough for enlightenment as a possibility.
When you become confused at death, depending on if you tried to mostly do good, you are given compassion by the Buddhas and have another go at it, and get it right. But if you're bad, you go to one of the hells and must realize your wrongs, and eventually get another go too. Then if you commit suicide, you go to the "hell" of suicide, where you suffer for the ignorance wasting this opportunity not to your fullest.
Unlike what other religions say though, if you do end up at death where you don't want, it's not permanent, and you eventually will understand and get out. It's not eternal suffering, liberation (Nirvana) is possible for all!
Therefore, don't say "what if my life is meaningless," instead, "I want to make this place a better place." Then you try the best you can, and eventually you will end this suffering in Samsara of endless rebirth and become a Buddha.
Everyone, including the self doubting OP has what's called a Tathagata-garbha, which mean the "womb" or "seed" of a Buddha. This is inside us all, but because of Maya (illusion) we don't realize we are in fact already a Buddha.
That doesn't mean we should say, "the Buddha said I'm a Buddha, so I need to do nothing." That's wrong! It's like having a gold mine and saying, "because I own a gold mine, the gold is there, so I don't need to mine it." Nope, you still need to cultivate proper Dharma and actually realize Buddhahood.
Take care,
Namo Amituofo!