Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A common enough pattern is to catch errors by their code, and then destroy them and handle them in some way. Add a helper to handle this. The helper always destroys the error and always NULLs the error pointer (which may otherwise be left to point at a stale error).
A less common short-cut is to directly compare error values to global error variables. In particular, "err == &drgn_not_found" should really be replaced with a catch statement that catches all DRGN_ERROR_LOOKUP. However, the others (drgn_stop, drgn_line_wrap, and drgn_enomem) are specialized enough that they probably don't merit this treatment.
Apply the new helper to the whole codebase.