[librsvg] Plug a mem leak



commit f0cdc794fc669ffd3c36c0dcc2a81f53df093450
Author: Christian Persch <chpe gnome org>
Date:   Sat Nov 12 00:20:12 2011 +0100

    Plug a mem leak
    
    ==7436== 31 (8 direct, 23 indirect) bytes in 1 blocks are definitely lost in loss record 243 of 355
    ==7436==    at 0x402AD89: malloc (vg_replace_malloc.c:236)
    ==7436==    by 0x4566BDA: standard_malloc (gmem.c:85)
    ==7436==    by 0x4566F80: g_malloc (gmem.c:159)
    ==7436==    by 0x456B4E3: parse_arg (goption.c:1242)
    ==7436==    by 0x456CDD6: g_option_context_parse (goption.c:1578)
    ==7436==    by 0x8049558: main (rsvg-convert.c:189)

 rsvg-convert.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-convert.c b/rsvg-convert.c
index 6a04926..739cb82 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -203,8 +203,11 @@ main (int argc, char **argv)
         output_file = fopen (output, "wb");
         if (!output_file) {
             fprintf (stderr, _("Error saving to file: %s\n"), output);
+            g_free (output);
             exit (1);
         }
+
+        g_free (output);
     }
 
     if (args)



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