[PATCH 3/4] winemenubuilder: Always free the string that extract_icon returns (Coverity)
Alex Henrie
alexhenrie24 at gmail.com
Tue Dec 28 22:14:10 CST 2021
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
programs/winemenubuilder/winemenubuilder.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c
index 1a11afb7791..900e81dbcf2 100644
--- a/programs/winemenubuilder/winemenubuilder.c
+++ b/programs/winemenubuilder/winemenubuilder.c
@@ -2018,6 +2018,7 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
struct wine_rb_tree mimeProgidTree = { winemenubuilder_rb_string_compare };
struct list nativeMimeTypes = LIST_INIT(nativeMimeTypes);
int i;
+ WCHAR *icon_name;
BOOL hasChanged = FALSE;
if (!build_native_mime_types(&nativeMimeTypes))
@@ -2078,8 +2079,9 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
*comma = 0;
index = wcstol(comma + 1, NULL, 10);
}
- extract_icon(iconW, index, flattened_mime, FALSE);
+ icon_name = extract_icon(iconW, index, flattened_mime, FALSE);
heap_free(flattened_mime);
+ heap_free(icon_name);
}
write_freedesktop_mime_type_entry(packages_dir, extensionW, mimeType, friendlyDocNameW);
@@ -2128,7 +2130,11 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
heap_free(desktopPath);
}
- if (hasChanged && openWithIcon) extract_icon(executableW, 0, openWithIcon, FALSE);
+ if (hasChanged && openWithIcon)
+ {
+ icon_name = extract_icon(executableW, 0, openWithIcon, FALSE);
+ heap_free(icon_name);
+ }
end:
heap_free(commandW);
--
2.34.1
More information about the wine-devel
mailing list