# HG changeset patch
# User ZyX <[email protected]>
# Date 1370092920 -14400
# Branch python-extended-4
# Node ID 0ee8bb6bd07f29fd51c7b753492ac727b69ac7ae
# Parent  f37c4b0b09f688698e23d14c6f915968d0868523
More possible memory leak fixes

diff -r f37c4b0b09f6 -r 0ee8bb6bd07f src/if_py_both.h
--- a/src/if_py_both.h  Sat Jun 01 19:52:54 2013 +0400
+++ b/src/if_py_both.h  Sat Jun 01 17:22:00 2013 +0400
@@ -1017,6 +1017,7 @@
     if (*key == NUL)
     {
        RAISE_NO_EMPTY_KEYS;
+       Py_XDECREF(todecref);
        return NULL;
     }
 
@@ -1171,6 +1172,7 @@
 
     if (!(key = StringToChars(keyObject, &todecref)))
        return -1;
+
     if (*key == NUL)
     {
        RAISE_NO_EMPTY_KEYS;
@@ -2204,9 +2206,11 @@
 
     if (!(key = StringToChars(keyObject, &todecref)))
        return NULL;
+
     if (*key == NUL)
     {
        RAISE_NO_EMPTY_KEYS;
+       Py_XDECREF(todecref);
        return NULL;
     }
 
@@ -2337,9 +2341,11 @@
 
     if (!(key = StringToChars(keyObject, &todecref)))
        return -1;
+
     if (*key == NUL)
     {
        RAISE_NO_EMPTY_KEYS;
+       Py_XDECREF(todecref);
        return -1;
     }
 
@@ -4556,6 +4562,7 @@
            dict_unref(dict);
            return -1;
        }
+
        if (*key == NUL)
        {
            dict_unref(dict);
@@ -4639,6 +4646,7 @@
            dict_unref(dict);
            return -1;
        }
+
        if (*key == NUL)
        {
            Py_DECREF(keyObject);

-- 
-- 
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.MqxLOH/vim.f37c4b0b09f6/src/if_py_both.h	2013-06-01 20:12:35.611342481 +0400
--- vim.0ee8bb6bd07f/src/if_py_both.h	2013-06-01 20:12:35.620342392 +0400
***************
*** 1017,1022 ****
--- 1017,1023 ----
      if (*key == NUL)
      {
  	RAISE_NO_EMPTY_KEYS;
+ 	Py_XDECREF(todecref);
  	return NULL;
      }
  
***************
*** 1171,1176 ****
--- 1172,1178 ----
  
      if (!(key = StringToChars(keyObject, &todecref)))
  	return -1;
+ 
      if (*key == NUL)
      {
  	RAISE_NO_EMPTY_KEYS;
***************
*** 2204,2212 ****
--- 2206,2216 ----
  
      if (!(key = StringToChars(keyObject, &todecref)))
  	return NULL;
+ 
      if (*key == NUL)
      {
  	RAISE_NO_EMPTY_KEYS;
+ 	Py_XDECREF(todecref);
  	return NULL;
      }
  
***************
*** 2337,2345 ****
--- 2341,2351 ----
  
      if (!(key = StringToChars(keyObject, &todecref)))
  	return -1;
+ 
      if (*key == NUL)
      {
  	RAISE_NO_EMPTY_KEYS;
+ 	Py_XDECREF(todecref);
  	return -1;
      }
  
***************
*** 4556,4561 ****
--- 4562,4568 ----
  	    dict_unref(dict);
  	    return -1;
  	}
+ 
  	if (*key == NUL)
  	{
  	    dict_unref(dict);
***************
*** 4639,4644 ****
--- 4646,4652 ----
  	    dict_unref(dict);
  	    return -1;
  	}
+ 
  	if (*key == NUL)
  	{
  	    Py_DECREF(keyObject);

Raspunde prin e-mail lui