]> granicus.if.org Git - python/commit
Issue #18408: Fix _PyMem_DebugRealloc()
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 8 Jul 2013 22:44:43 +0000 (00:44 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 8 Jul 2013 22:44:43 +0000 (00:44 +0200)
commitc4266360fc70745d49b09f2c29cda91c1a007525
treeff5dd727f232097d2b7c87dcf9095388f3b1c49b
parent9e6b4d715c46c0fa518fd76440b59516a9f6f7ea
Issue #18408: Fix _PyMem_DebugRealloc()

Don't mark old extra memory dead before calling realloc(). realloc() can fail
and realloc() must not touch the original buffer on failure.

So mark old extra memory dead only on success if the new buffer did not move
(has the same address).
Objects/obmalloc.c