From 84a3e221812fd50c9b4479bab446c05a379fd676 Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Sun, 6 Nov 2011 16:22:21 +0000 Subject: [PATCH] Clip: On failure, remember to free the allocated buffer Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@42297 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/c/shellcommands/Clip.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workbench/c/shellcommands/Clip.c b/workbench/c/shellcommands/Clip.c index e677d0400f..78472f917f 100644 --- a/workbench/c/shellcommands/Clip.c +++ b/workbench/c/shellcommands/Clip.c @@ -303,6 +303,11 @@ STRPTR fromClip(UBYTE clipUnit, struct Library *IFFParseBase) filebuffer[filebuffer_size] = '\0'; } /* if ((cn->cn_Type == ID_FTXT) && (cn->cn_ID == ID_CHRS)) */ } /* for(;;) */ + + if (filebuffer && !ok) { + FreeVec(filebuffer); + filebuffer = NULL; + } } /* if (!StopChunk(iff, ID_FTXT, ID_CHRS)) */ CloseIFF(iff); } /* if (!OpenIFF(iff, IFFF_READ)) */ -- 2.11.4.GIT