memory leak in client_list

Bug #853362 reported by Wez Furlong
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subvertpy
Fix Released
Medium
Wez Furlong

Bug Description

I'm writing an svn->hg migration tool which makes relatively heavy use of this function over many revisions and noticed that memory usage was increasing. With the help of the "Instruments" tool on OS/X, I determined that there were two leaks in the success path; one of the temporary apr pool and the other of a reference to the dict created by the list_receiver.

The following patch appears to address the issue, with the caveat that I am not especially familiar with the python guts!

=== modified file 'subvertpy/client.c'
--- subvertpy/client.c 2011-09-18 17:14:02 +0000
+++ subvertpy/client.c 2011-09-18 17:14:06 +0000
@@ -165,6 +165,7 @@
     }

     PyDict_SetItemString(dict, path, value);
+ Py_DECREF(value);

     PyGILState_Release(state);

@@ -1105,6 +1106,7 @@
                                        list_receiver, entry_dict,
                                        client->client, temp_pool));
 #endif
+ apr_pool_destroy(temp_pool);

     return entry_dict;
 }

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks for the patch! Your solution is fine, so I've pushed it to trunk.

Changed in subvertpy:
status: New → Triaged
importance: Undecided → Medium
status: Triaged → Fix Committed
assignee: nobody → Wez Furlong (wezfurlong)
milestone: none → 0.8.6
Jelmer Vernooij (jelmer)
Changed in subvertpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.