From 4b208c603a994c4d04361f10a47ebfc2082e9a8a Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Fri, 21 Nov 2008 16:08:51 +0000 Subject: [PATCH] Ensure memory is freed if the acuisition of the bind names fails entirely. --- Cursor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cursor.c b/Cursor.c index 339262e..d1c3491 100644 --- a/Cursor.c +++ b/Cursor.c @@ -403,8 +403,10 @@ static int Cursor_GetBindNames( indicatorNameLengths, duplicate, bindHandles); if (status != OCI_NO_DATA && Environment_CheckForError(self->environment, status, - "Cursor_GetBindNames()") < 0) + "Cursor_GetBindNames()") < 0) { + PyMem_Free(buffer); return -1; + } if (foundElements < 0) { *names = NULL; PyMem_Free(buffer);