Skip to content

Commit 30ac9d5

Browse files
committed
Respond to review comments (2)
1 parent 7c0d002 commit 30ac9d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/_zstd/zstddict.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ _zstd_ZstdDict_new_impl(PyTypeObject *type, Py_buffer *dict_content,
4949
/* All dictionaries must be at least 8 bytes */
5050
if (dict_content->len < 8) {
5151
PyErr_SetString(PyExc_ValueError,
52-
"Zstandard dictionary content should at least "
53-
"8 bytes.");
52+
"Zstandard dictionary content must be longer "
53+
"than eight bytes.");
5454
goto error;
5555
}
5656

@@ -72,8 +72,8 @@ _zstd_ZstdDict_new_impl(PyTypeObject *type, Py_buffer *dict_content,
7272

7373
self->dict_buffer = PyMem_Malloc(dict_content->len);
7474
if (!self->dict_buffer) {
75-
Py_DECREF(self);
76-
return PyErr_NoMemory();
75+
PyErr_NoMemory();
76+
goto error;
7777
}
7878
memcpy(self->dict_buffer, dict_content->buf, dict_content->len);
7979
self->dict_len = dict_content->len;

0 commit comments

Comments
 (0)