From 996b8f015dbd7694d8c5b9ce146455fe9a876f65 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Wed, 25 Oct 2023 18:20:08 +0200 Subject: [PATCH] more like this part --- src/winshortcut.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/winshortcut.cpp b/src/winshortcut.cpp index 4de7340a..372dc5a5 100644 --- a/src/winshortcut.cpp +++ b/src/winshortcut.cpp @@ -198,15 +198,9 @@ static PyObject *CreateShortcut(PyObject *self, PyObject *args) pPersistFile->Release(); pShellLink->Release(); - if (path) { - PyMem_Free(path); - } - if (description) { - PyMem_Free(description); - } - if (filename) { - PyMem_Free(filename); - } + PyMem_Free(path); + PyMem_Free(description); + PyMem_Free(filename); Py_DECREF(py_path); Py_DECREF(py_description); @@ -230,9 +224,15 @@ static PyObject *CreateShortcut(PyObject *self, PyObject *args) pPropertyStore->Release(); } - PyMem_Free(path); - PyMem_Free(description); - PyMem_Free(filename); + if (path) { + PyMem_Free(path); + } + if (description) { + PyMem_Free(description); + } + if (filename) { + PyMem_Free(filename); + } Py_DECREF(py_path); Py_DECREF(py_description);