You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I may have found a leak in name.c -> addName()
In name.c, line 168:
static void addName(nameCtx h,
unsigned short platformId,
unsigned short platspecId,
unsigned short languageId,
unsigned short nameId,
size_t length, char *str) {
char *dst;
char *newStr;
newStr = MEM_NEW(h->g, length * sizeof(char)); <<-- ALLOCATED
NameRecord *rec;
int index;
int omitMacNames = (h->g->convertFlags & HOT_OMIT_MAC_NAMES); /* omit all Mac platform names. */
if (platformId == HOT_NAME_MAC_PLATFORM) {
if (omitMacNames)
return;
}
if (omitMacNames && (platformId == HOT_NAME_MAC_PLATFORM)) {
return;
}
First, it looks like the last 3 lines — and the 4 lines before that — effectively do the same thing: return early if it's Mac and we're not writing Mac platform names. However, newStr is allocated before that return and not released until near the end of the function, which would cause a leak, I believe.
The text was updated successfully, but these errors were encountered:
I think I may have found a leak in
name.c -> addName()
In name.c, line 168:
First, it looks like the last 3 lines — and the 4 lines before that — effectively do the same thing: return early if it's Mac and we're not writing Mac platform names. However,
newStr
is allocated before thatreturn
and not released until near the end of the function, which would cause a leak, I believe.The text was updated successfully, but these errors were encountered: