DICTKEY_UNREF
copy_tv(&tv, &di->di_tv);
+ clear_tv(&tv);
return 0;
}
{
if (list_append_tv(l, &tv) == FAIL)
{
+ clear_tv(&tv);
PyErr_SetVim(_("Failed to add item to list"));
return -1;
}
li = list_find(l, (long) index);
clear_tv(&li->li_tv);
copy_tv(&tv, &li->li_tv);
+ clear_tv(&tv);
}
return 0;
}
return -1;
if (list_insert_tv(l, &v, li) == FAIL)
{
+ clear_tv(&v);
PyErr_SetVim(_("internal error: failed to add item to list"));
return -1;
}
+ clear_tv(&v);
}
return 0;
}
return NULL;
}
if (ConvertFromPyObject(selfdictObject, &selfdicttv) == -1)
+ {
+ clear_tv(&args);
return NULL;
+ }
selfdict = selfdicttv.vval.v_dict;
}
}
else
result = ConvertToPyObject(&rettv);
- /* FIXME Check what should really be cleared. */
clear_tv(&args);
clear_tv(&rettv);
- /*
- * if (selfdict!=NULL)
- * clear_tv(selfdicttv);
- */
+ if (selfdict != NULL)
+ clear_tv(&selfdicttv);
return result;
}
}
else if (flags & SOPT_BOOL)
{
- PyObject *r;
+ PyObject *r;
r = numval ? Py_True : Py_False;
Py_INCREF(r);
return r;
else if (flags & SOPT_STRING)
{
if (stringval)
- return PyBytes_FromString((char *) stringval);
+ {
+ PyObject *r = PyBytes_FromString((char *) stringval);
+ vim_free(stringval);
+ return r;
+ }
else
{
PyErr_SetString(PyExc_RuntimeError,
int opt_type;
void *from;
{
- win_T *save_curwin;
- tabpage_T *save_curtab;
- buf_T *save_curbuf;
+ win_T *save_curwin = NULL;
+ tabpage_T *save_curtab = NULL;
+ buf_T *save_curbuf = NULL;
VimTryStart();
switch (opt_type)