diff --git a/src/manage_sql.c b/src/manage_sql.c
index b41e5c6..48e3fdb 100644
--- a/src/manage_sql.c
+++ b/src/manage_sql.c
@@ -15276,7 +15276,9 @@ update_nvti_cache ()
 
   cleanup_iterator (&nvts);
 
-  malloc_trim (0);
+#ifdef __GLIBC__
+   malloc_trim (0);
+#endif
 }
 
 /**
