[gnome-control-center] network: Fix a possible memory leak in QR code



commit 0452e9eb4ddfda5c9245c0d38b102e82b29bf34a
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Fri Feb 11 11:25:59 2022 +0530

    network: Fix a possible memory leak in QR code
    
    It's possible that the QR code for the same text has been requested,
    but for a different size.  Fix a memory leak that would happen
    in those cases.

 panels/network/cc-qr-code.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/panels/network/cc-qr-code.c b/panels/network/cc-qr-code.c
index 08f41b5e4..8bb8a14cf 100644
--- a/panels/network/cc-qr-code.c
+++ b/panels/network/cc-qr-code.c
@@ -175,6 +175,7 @@ cc_qr_code_get_paintable (CcQrCode *self,
 
   bytes = g_byte_array_free_to_bytes (qr_matrix);
 
+  g_clear_object (&self->texture);
   self->texture = gdk_memory_texture_new (total_size,
                                           total_size,
                                           GDK_MEMORY_R8G8B8,


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