From 8a95fe65aeb319787daaf6a90b47f8cb39ef485a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Milkovi=C4=8D?= Date: Wed, 29 Mar 2023 17:08:12 +0200 Subject: [PATCH] Fixed dotnet module failure on Windows 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(). --- libyara/modules/dotnet/dotnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libyara/modules/dotnet/dotnet.c b/libyara/modules/dotnet/dotnet.c index 5c2b496eef..0968d4c331 100644 --- a/libyara/modules/dotnet/dotnet.c +++ b/libyara/modules/dotnet/dotnet.c @@ -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))