diff --git a/src/calibre/utils/spell/hunspell_wrapper.cpp b/src/calibre/utils/spell/hunspell_wrapper.cpp index 0a672fd6d6..098b496b5f 100644 --- a/src/calibre/utils/spell/hunspell_wrapper.cpp +++ b/src/calibre/utils/spell/hunspell_wrapper.cpp @@ -77,7 +77,7 @@ suggest(Dictionary *self, PyObject *args) { const std::vector& word_list = self->handle->suggest(word); ans = PyTuple_New(word_list.size()); - if (ans == NULL) PyErr_NoMemory(); + if (ans == NULL) return PyErr_NoMemory(); Py_ssize_t i = 0; for(auto const& s: word_list) { temp = PyUnicode_Decode(s.c_str(), s.size(), self->encoding, "strict");