From 0e7c6aa5e12eefc06d96b83316a787d0de5d8282 Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Thu, 2 Nov 2023 06:16:20 -0300 Subject: [PATCH] vcscanf: free buf before returning if not NULL This condition indicates that the floating point parser exited early. --- libc/stdio/vcscanf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libc/stdio/vcscanf.c b/libc/stdio/vcscanf.c index 49f2bed59..5bec3efd8 100644 --- a/libc/stdio/vcscanf.c +++ b/libc/stdio/vcscanf.c @@ -393,5 +393,6 @@ Done: if (items == -1) free(entry->ptr); free(entry); } + if (buf) free(buf); return items; }