mercurial/dirs.c
changeset 25092 f41539418b41
parent 25016 42e89b87ca79
child 25093 fe3a72a3e7ca
--- a/mercurial/dirs.c	Mon Apr 13 23:21:02 2015 -0700
+++ b/mercurial/dirs.c	Fri May 08 14:11:00 2015 -0700
@@ -95,6 +95,7 @@
 
 static int _delpath(PyObject *dirs, PyObject *path)
 {
+	char *cpath = PyString_AS_STRING(path);
 	Py_ssize_t pos = PyString_GET_SIZE(path);
 	PyObject *key = NULL;
 	int ret = -1;
@@ -102,7 +103,7 @@
 	while ((pos = _finddir(path, pos - 1)) != -1) {
 		PyObject *val;
 
-		key = PyString_FromStringAndSize(PyString_AS_STRING(path), pos);
+		key = PyString_FromStringAndSize(cpath, pos);
 
 		if (key == NULL)
 			goto bail;