Skip to content

Commit

Permalink
Fixed dotnet module failed on Windows
Browse files Browse the repository at this point in the history
create_full_name() used strdup() even on Windows where all str*
functions are masked behind yr_str*() functions which internally used
HeapAlloc()/HeapFree() which does not cooperate well with
malloc()/free().
  • Loading branch information
metthal committed Mar 29, 2023
1 parent 65feab4 commit bc8c917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libyara/modules/dotnet/dotnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static const char* get_typedef_type(uint32_t flags)
static char* create_full_name(const char* name, const char* namespace)
{
if (!name || !strlen(name))
return namespace ? strdup(namespace) : NULL;
return namespace ? yr_strdup(namespace) : NULL;

// No namespace -> return name only
if (!namespace || !strlen(namespace))
Expand Down

0 comments on commit bc8c917

Please sign in to comment.