# HG changeset patch
# User ZyX <[email protected]>
# Date 1386410239 -14400
# Sat Dec 07 13:57:19 2013 +0400
# Branch fix-sa-warning-1
# Node ID c87415f3c0adc44106d6c2944c53f721c94cc6f5
# Parent 486655e0c5a21469364d3cf895535137f09b3724
Fix error found by @Ken Takata
diff -r 486655e0c5a2 -r c87415f3c0ad src/if_py_both.h
--- a/src/if_py_both.h Thu Nov 28 19:27:30 2013 +0100
+++ b/src/if_py_both.h Sat Dec 07 13:57:19 2013 +0400
@@ -3005,11 +3005,14 @@
else
{
char_u *val;
- PyObject *todecref;
-
- if ((val = StringToChars(valObject, &todecref)))
+ PyObject *todecref2;
+
+ if ((val = StringToChars(valObject, &todecref2)))
+ {
ret = set_option_value_for(key, 0, val, opt_flags,
self->opt_type, self->from);
+ Py_XDECREF(todecref2);
+ }
else
ret = -1;
}
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
*** /tmp/extdiff.E8EA8e/vim-small-patches.486655e0c5a2/src/if_py_both.h 2013-12-07 14:01:54.979342986 +0400
--- vim-small-patches.c87415f3c0ad/src/if_py_both.h 2013-12-07 14:01:54.982342986 +0400
***************
*** 3005,3015 ****
else
{
char_u *val;
! PyObject *todecref;
! if ((val = StringToChars(valObject, &todecref)))
ret = set_option_value_for(key, 0, val, opt_flags,
self->opt_type, self->from);
else
ret = -1;
}
--- 3005,3018 ----
else
{
char_u *val;
! PyObject *todecref2;
! if ((val = StringToChars(valObject, &todecref2)))
! {
ret = set_option_value_for(key, 0, val, opt_flags,
self->opt_type, self->from);
+ Py_XDECREF(todecref2);
+ }
else
ret = -1;
}