Closed lpereira closed 9 years ago
Your diff looks correct. But match_error() will also set ms.error to non-NULL so it should enter the error case and not go into the calloc().
Yes, you're right -- however Coverity was complaining. Also, under OpenBSD, calloc() would most likely return NULL if a negative number were to be passed to the first argument due to overflow protection anyway. But the "fix" is simple enough.
It might return the return value of match_error(), which returns (-1). This value is then passed to calloc(), which expects a size_t.