parsers: correctly decref normed value after PyDict_SetItem
Previously we were leaving this PyObject* with a refcount that was one
too high. Detected with cpychecker.
--- a/mercurial/parsers.c Tue Aug 18 17:15:04 2015 -0400
+++ b/mercurial/parsers.c Tue Aug 18 16:43:26 2015 -0400
@@ -253,8 +253,11 @@
if (normed == NULL)
goto quit;
- if (PyDict_SetItem(file_foldmap, normed, k) == -1)
+ if (PyDict_SetItem(file_foldmap, normed, k) == -1) {
+ Py_DECREF(normed);
goto quit;
+ }
+ Py_DECREF(normed);
}
}
return file_foldmap;