After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655556 - Memory leak in function cogl_polygon in cogl-primitives.c
Memory leak in function cogl_polygon in cogl-primitives.c
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: general
1.7.x
Other Linux
: Normal critical
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-07-29 08:47 UTC by Florian Renaut
Modified: 2011-08-01 13:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixed cogl-primitives.c (39.78 KB, text/x-csrc)
2011-07-29 08:47 UTC, Florian Renaut
  Details
cogl-primitives: Plug some leaks in cogl_polygon (2.10 KB, patch)
2011-07-29 16:26 UTC, Neil Roberts
none Details | Review

Description Florian Renaut 2011-07-29 08:47:56 UTC
Created attachment 192856 [details]
Fixed cogl-primitives.c

Hi,

I think the function cogl_polygon in file cogl-primitives.c is causing a memory leak (cogl version 1.7.4).

 - Line 1099 : g_strdup_printf ("cogl_tex_coord%d_in", i)
     The allocated string is never freeed.
     Should add "if (i >= 8) g_free (name);" at line 1109.

 - The CoglAttribute and CoglAttributeBuffer created are not destroyed,
   at the end of cogl_polygon function, should add :

     for (i = 0; i < n_attributes; i++) {
       cogl_object_unref (attributes[i]);
     }
     cogl_object_unref (attribute_buffer);
Comment 1 Neil Roberts 2011-07-29 16:26:49 UTC
Created attachment 192881 [details] [review]
cogl-primitives: Plug some leaks in cogl_polygon

Thanks. Here are the same changes made into a patch.
Comment 2 Neil Roberts 2011-08-01 13:32:54 UTC
Pushed as bbbe6db2847f36e0a. Thanks again.