@@ -45,8 +45,9 @@ PyObject *PyIQueryAssociations::Init(PyObject *self, PyObject *args)
45
45
HRESULT hr;
46
46
PY_INTERFACE_PRECALL;
47
47
hr = pIQA->Init (flags, pszAssoc, hkProgid, hwnd);
48
- PyWinObject_FreeWCHAR (pszAssoc);
49
48
PY_INTERFACE_POSTCALL;
49
+ PyWinObject_FreeWCHAR (pszAssoc);
50
+
50
51
if (FAILED (hr))
51
52
return PyCom_BuildPyException (hr, pIQA, IID_IQueryAssociations);
52
53
Py_INCREF (Py_None);
@@ -77,8 +78,8 @@ PyObject *PyIQueryAssociations::GetKey(PyObject *self, PyObject *args)
77
78
HRESULT hr;
78
79
PY_INTERFACE_PRECALL;
79
80
hr = pIQA->GetKey (flags, (ASSOCKEY)assoc, pszExtra, &ret);
80
- PyWinObject_FreeWCHAR (pszExtra);
81
81
PY_INTERFACE_POSTCALL;
82
+ PyWinObject_FreeWCHAR (pszExtra);
82
83
if (FAILED (hr))
83
84
return PyCom_BuildPyException (hr, pIQA, IID_IQueryAssociations);
84
85
// observation of the "open handles" count in task-manager indicates
@@ -116,8 +117,8 @@ PyObject *PyIQueryAssociations::GetString(PyObject *self, PyObject *args)
116
117
HRESULT hr;
117
118
PY_INTERFACE_PRECALL;
118
119
hr = pIQA->GetString (flags, (ASSOCSTR)assoc, pszExtra, result_buf, &result_size);
119
- PyWinObject_FreeWCHAR (pszExtra);
120
120
PY_INTERFACE_POSTCALL;
121
+ PyWinObject_FreeWCHAR (pszExtra);
121
122
if (FAILED (hr))
122
123
return PyCom_BuildPyException (hr, pIQA, IID_IQueryAssociations);
123
124
// docs don't explicitly say if result_size includes NULL. It says:
0 commit comments