st-private_fix_memory_leak.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 72f9f482d6f1bcb53ea2bd1606818af1f33a5a8c Mon Sep 17 00:00:00 2001
  2. From: Colin Walters <walters@verbum.org>
  3. Date: Thu, 05 May 2011 19:21:58 +0000
  4. Subject: st-private: Fix memory leak
  5. ==13810== 11,360 bytes in 1 blocks are definitely lost in loss record 18,574 of 18,765
  6. ==13810== at 0x4005447: calloc (vg_replace_malloc.c:467)
  7. ==13810== by 0x5191882: standard_calloc (gmem.c:107)
  8. ==13810== by 0x51920A7: g_malloc0 (gmem.c:196)
  9. ==13810== by 0x4056201: blur_pixels (st-private.c:466)
  10. ==13810== by 0x40573B4: _st_create_shadow_cairo_pattern (st-private.c:710)
  11. ==13810== by 0x4070746: st_theme_node_paint (st-theme-node-drawing.c:856)
  12. ==13810== by 0x3FEFFFFF: ???
  13. https://bugzilla.gnome.org/show_bug.cgi?id=649497
  14. ---
  15. diff --git a/src/st/st-private.c b/src/st/st-private.c
  16. index d0aa89b..51798a1 100644
  17. --- a/src/st/st-private.c
  18. +++ b/src/st/st-private.c
  19. @@ -746,7 +746,7 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
  20. (height_out - height_in) / 2.0);
  21. cairo_pattern_set_matrix (dst_pattern, &shadow_matrix);
  22. - return dst_pattern;
  23. + goto out;
  24. }
  25. /* Read all the code from the cairo_pattern_set_matrix call
  26. @@ -784,6 +784,8 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec,
  27. cairo_pattern_set_matrix (dst_pattern, &shadow_matrix);
  28. + out:
  29. + g_free (pixels_out);
  30. return dst_pattern;
  31. }
  32. --
  33. cgit v0.9