Mercurial > cpython-lru_cache-weakref
view PC/example_nt/example.c @ 25838:8540887bcec6 2.2
Backport of 2.183:
Fix memory leak in add_subclass() found by NealN with valgrind.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 18 Oct 2002 13:42:21 +0000 |
| parents | a1ce07218781 |
| children | 834fd9b3ceee |
line wrap: on
line source
#include "Python.h" static PyObject * ex_foo(PyObject *self, PyObject *args) { printf("Hello, world\n"); Py_INCREF(Py_None); return Py_None; } static PyMethodDef example_methods[] = { {"foo", ex_foo, 1, "foo() doc string"}, {NULL, NULL} }; void initexample(void) { Py_InitModule("example", example_methods); }
