[PATCH v3 1/3] xmllite/reader: Avoid memory leak on error path

David Kahurani wine at gitlab.winehq.org
Mon Jun 20 12:24:37 CDT 2022


From: David Kahurani <k.kahurani at gmail.com>

attr->value should not be freed as it was not allocated attr->localname
should instead having just being previously allocated and not freed
anywhere else

Signed-off-by: David Kahurani <k.kahurani at gmail.com>
---
 dlls/xmllite/reader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/xmllite/reader.c b/dlls/xmllite/reader.c
index 4045b4dfcca..d99f121e0cb 100644
--- a/dlls/xmllite/reader.c
+++ b/dlls/xmllite/reader.c
@@ -424,7 +424,7 @@ static HRESULT reader_add_attr(xmlreader *reader, strval *prefix, strval *localn
     {
         hr = reader_strvaldup(reader, value, &attr->value);
         if (hr != S_OK)
-            reader_free_strvalued(reader, &attr->value);
+            reader_free_strvalued(reader, &attr->localname);
     }
     if (hr != S_OK)
     {
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/281



More information about the wine-devel mailing list