[libsoup/carlosgc/no-aliases: 2/3] logger: Fix memory leak




commit cc9fbb8c29152b27d83aabe297add19309dd60c8
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Feb 11 11:09:58 2021 +0100

    logger: Fix memory leak

 libsoup/soup-logger.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/libsoup/soup-logger.c b/libsoup/soup-logger.c
index 86fce4dc..8cf01b10 100644
--- a/libsoup/soup-logger.c
+++ b/libsoup/soup-logger.c
@@ -140,9 +140,12 @@ static void
 soup_logger_init (SoupLogger *logger)
 {
        SoupLoggerPrivate *priv = soup_logger_get_instance_private (logger);
+       char *id;
 
        g_mutex_init (&priv->lock);
-       priv->tag = g_quark_from_static_string (g_strdup_printf ("SoupLogger-%p", logger));
+       id = g_strdup_printf ("SoupLogger-%p", logger);
+       priv->tag = g_quark_from_string (id);
+       g_free (id);
        priv->ids = g_hash_table_new (NULL, NULL);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]