]> git.sesse.net Git - vlc/commitdiff
Fix potential memleak.
authorRémi Duraffort <ivoire@videolan.org>
Fri, 15 Aug 2008 07:14:27 +0000 (09:14 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 15 Aug 2008 19:44:27 +0000 (21:44 +0200)
modules/misc/freetype.c
modules/misc/quartztext.c

index ec6dadf6457ce82b17df1a3acd7f685944f09307..57dbc9dbb657320d2f2fd454c1d3450dedfccf6c 100644 (file)
@@ -1862,9 +1862,9 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
                 i_font_alpha = strtol( psz_value + 1, NULL, 16 );
                 i_font_alpha &= 0xff;
             }
-            free( psz_name );
-            free( psz_value );
         }
+        free( psz_name );
+        free( psz_value );
     }
     rv = PushFont( p_fonts,
                    psz_fontname,
index 27517e419c80e3a4a6bacf6859a2884c9abdf0f0..f6bb1f52b0bdef4dbec612140a087be48ec2a451 100644 (file)
@@ -663,9 +663,9 @@ static int HandleFontAttributes( xml_reader_t *p_xml_reader,
                 i_font_alpha = strtol( psz_value + 1, NULL, 16 );
                 i_font_alpha &= 0xff;
             }
-            free( psz_name );
-            free( psz_value );
         }
+        free( psz_name );
+        free( psz_value );
     }
     rv = PushFont( p_fonts,
                    psz_fontname,
@@ -736,7 +736,6 @@ static int ProcessNodes( filter_t *p_filter,
                 break;
             case XML_READER_ENDELEM:
                 psz_node = xml_ReaderName( p_xml_reader );
-
                 if( psz_node )
                 {
                     if( !strcasecmp( "font", psz_node ) )