[Python-Dev] cpython: fixd refleak

Antoine Pitrou solipsis at pitrou.net
Thu Jun 13 20:59:13 CEST 2013


On Mon, 10 Jun 2013 10:47:28 +0200 (CEST)
christian.heimes <python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/6860263c05b3
> changeset:   84077:6860263c05b3
> user:        Christian Heimes <christian at cheimes.de>
> date:        Mon Jun 10 10:47:22 2013 +0200
> summary:
>   fixd refleak
> 
[...]
> -    return Py_BuildValue("(OOOO)", ofile_env, ofile, odir_env, odir);
> +    if ((tup = PyTuple_New(4)) == NULL) {
> +        goto error;
> +    }
> +    PyTuple_SET_ITEM(tup, 0, ofile_env);
> +    PyTuple_SET_ITEM(tup, 1, ofile);
> +    PyTuple_SET_ITEM(tup, 2, odir_env);
> +    PyTuple_SET_ITEM(tup, 3, odir);
> +    return tup;

How about

    return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);

?




More information about the Python-Dev mailing list