diff --git a/src/libsysprof-capture/sysprof-collector.c b/src/libsysprof-capture/sysprof-collector.c index c00765b3..d36b7f47 100644 --- a/src/libsysprof-capture/sysprof-collector.c +++ b/src/libsysprof-capture/sysprof-collector.c @@ -65,7 +65,9 @@ #ifdef __linux__ # include #endif +#include #include +#include #include #include #include @@ -466,14 +468,14 @@ sysprof_collector_log_printf (int severity, ...) { COLLECTOR_BEGIN { - g_autofree char *formatted = NULL; + char formatted[2048]; SysprofCaptureLog *ev; va_list args; size_t len; size_t sl; va_start (args, format); - formatted = g_strdup_vprintf (format, args); + vsnprintf (formatted, sizeof (formatted), format, args); va_end (args); if (domain == NULL)