A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/python/cpython/commit/c0cabc23bbe474d542ff8a4f1243f4ec3cce5549 below:

Fix refleaks when zipimporter.__init__() is called more th… · python/cpython@c0cabc2 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+6

-5

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+6

-5

lines changed Original file line number Diff line number Diff line change

@@ -164,10 +164,10 @@ zipimport_zipimporter___init___impl(ZipImporter *self, PyObject *path)

164 164

}

165 165

else

166 166

Py_INCREF(files);

167 -

self->files = files;

167 +

Py_XSETREF(self->files, files);

168 168 169 169

/* Transfer reference */

170 -

self->archive = filename;

170 +

Py_XSETREF(self->archive, filename);

171 171

filename = NULL;

172 172 173 173

/* Check if there is a prefix directory following the filename. */

@@ -176,7 +176,7 @@ zipimport_zipimporter___init___impl(ZipImporter *self, PyObject *path)

176 176

PyUnicode_GET_LENGTH(path));

177 177

if (tmp == NULL)

178 178

goto error;

179 -

self->prefix = tmp;

179 +

Py_XSETREF(self->prefix, tmp);

180 180

if (PyUnicode_READ_CHAR(path, len-1) != SEP) {

181 181

/* add trailing SEP */

182 182

tmp = PyUnicode_FromFormat("%U%c", self->prefix, SEP);

@@ -185,8 +185,9 @@ zipimport_zipimporter___init___impl(ZipImporter *self, PyObject *path)

185 185

Py_SETREF(self->prefix, tmp);

186 186

}

187 187

}

188 -

else

189 -

self->prefix = PyUnicode_New(0, 0);

188 +

else {

189 +

Py_XSETREF(self->prefix, PyUnicode_New(0, 0));

190 +

}

190 191

Py_DECREF(path);

191 192

return 0;

192 193

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4