preg: ensure 'extra' is nonnull

Follow-up to pull request #2927.