Skip to content

Commit

Permalink
more like this part
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Oct 25, 2023
1 parent f69c258 commit 996b8f0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/winshortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 996b8f0

Please sign in to comment.