Try to push a pull request to the original project, if it is Open Source.
If it is useful to you, it may be useful to others.
The pull request may not be directly merged, since the project owners may have some requirements (testing, code format, comments, documentation, cross-platform...).
It is a great way to enhance your abilities, and give back to the community.
For 3rd party non-free components, it is more difficult.
You may use the branch feature of a SCM (git or fossil e.g.) to backport the original 3rd pary code updates to your patched branch.