diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a483432..8d5f816 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,9 @@ on: branches: [main] pull_request: +permissions: + contents: read + jobs: format: name: clang-format check diff --git a/python/uUR.c b/python/uUR.c index 16d6b13..69b43a3 100644 --- a/python/uUR.c +++ b/python/uUR.c @@ -573,7 +573,6 @@ static PyObject *UREncoder_next_part(uUR_UREncoder *self, PyObject *ignored) { char *part = NULL; bool ok = ur_encoder_next_part(self->encoder, &part); if (!ok) { - free(part); PyErr_SetString(PyExc_RuntimeError, "Failed to generate next part"); return NULL; } diff --git a/uUR.c b/uUR.c index def8f62..123d5d3 100644 --- a/uUR.c +++ b/uUR.c @@ -551,9 +551,6 @@ static mp_obj_t ur_encoder_next_part_py(mp_obj_t self_in) { bool result = ur_encoder_next_part(self->encoder, &ur_part); if (!result) { - if (ur_part) { - free(ur_part); - } mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("Failed to generate next part")); }