aboutsummaryrefslogtreecommitdiffstats
path: root/community/gvm-libs/malloc-trim.patch
blob: fb566b50b02926964cdf53ddbcd61ee7b63e6ef3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/base/hosts.c b/base/hosts.c
index 74f5d92..1073e2c 100644
--- a/base/hosts.c
+++ b/base/hosts.c
@@ -1013,7 +1013,9 @@ gvm_hosts_deduplicate (gvm_hosts_t *hosts)
   hosts->count -= duplicates;
   hosts->removed += duplicates;
   hosts->current = 0;
+#ifdef __GLIBC__
   malloc_trim (0);
+#endif
 }
 
 /**
@@ -1208,7 +1210,9 @@ gvm_hosts_new_with_max (const gchar *hosts_str, unsigned int max_hosts)
     gvm_hosts_deduplicate (hosts);
 
   g_strfreev (split);
+#ifdef __GLIBC__
   malloc_trim (0);
+#endif
   return hosts;
 }