-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path222716.mypatch
52 lines (44 loc) · 2.2 KB
/
222716.mypatch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From: Alex Henrie <[email protected]>
Subject: [PATCH 3/4] winemenubuilder: Always free the string that extract_icon returns (Coverity)
Message-Id: <[email protected]>
Date: Tue, 28 Dec 2021 21:14:10 -0700
In-Reply-To: <[email protected]>
References: <[email protected]>
Signed-off-by: Alex Henrie <[email protected]>
---
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