diff --git a/iwlib/utils.h b/iwlib/utils.h index fc37ea2..0589c82 100644 --- a/iwlib/utils.h +++ b/iwlib/utils.h @@ -13,8 +13,10 @@ #define SAFE_SETITEMSTRING(dict, key, value) do { \ PyObject *__tmp; \ __tmp = value; \ - if (__tmp) \ + if (__tmp) { \ PyDict_SetItemString(dict, key, __tmp); \ + Py_DECREF(__tmp); \ + } \ } while(0)