[libgxps] Fixed memory leak when UnicodeString and Indices are missing from Glyphs



commit 4963867edbece91865e3aa03b58608f3a163b9de
Author: Jason Crain <jason aquaticape us>
Date:   Sun Oct 9 14:30:26 2011 -0500

    Fixed memory leak when UnicodeString and Indices are missing from Glyphs

 libgxps/gxps-page.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libgxps/gxps-page.c b/libgxps/gxps-page.c
index d3ef767..28520bc 100644
--- a/libgxps/gxps-page.c
+++ b/libgxps/gxps-page.c
@@ -2376,6 +2376,17 @@ gxps_glyphs_to_cairo_glyphs (GXPSGlyphs            *gxps_glyphs,
                                      GXPS_PAGE_ERROR,
                                      GXPS_PAGE_ERROR_RENDER,
                                      "Error parsing glyphs: Both UnicodeString and Indices are empty");
+
+                        *num_glyphs = 0;
+                        *glyphs = NULL;
+                        g_array_free (glyph_array, TRUE);
+
+                        if (clusters) {
+                                *num_clusters = 0;
+                                *clusters = NULL;
+                                g_array_free (cluster_array, TRUE);
+                        }
+
                         return FALSE;
                 }
 



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