]> git.sesse.net Git - mlt/commitdiff
Fix minor memory leak found with valgrind.
authorDan Dennedy <dan@dennedy.org>
Sat, 24 Nov 2012 01:45:39 +0000 (17:45 -0800)
committerDan Dennedy <dan@dennedy.org>
Sat, 24 Nov 2012 01:45:39 +0000 (17:45 -0800)
src/modules/avformat/consumer_avformat.c

index cd8e8d0291b0416eae09decc2ff8085dcad8fb9f..20b85eb86ea43e7f9305c4d9b4c69cc7242043b5 100644 (file)
@@ -222,7 +222,9 @@ static int consumer_start( mlt_consumer consumer )
                        snprintf( key, sizeof(key), "%d", mlt_properties_count( formats ) );
                        mlt_properties_set( formats, key, format->name );
                }
-               fprintf( stdout, "%s", mlt_properties_serialise_yaml( doc ) );
+               s = mlt_properties_serialise_yaml( doc );
+               fprintf( stdout, "%s", s );
+               free( s );
                mlt_properties_close( doc );
                error = 1;
        }
@@ -248,7 +250,9 @@ static int consumer_start( mlt_consumer consumer )
                                snprintf( key, sizeof(key), "%d", mlt_properties_count( codecs ) );
                                mlt_properties_set( codecs, key, codec->name );
                        }
-               fprintf( stdout, "%s", mlt_properties_serialise_yaml( doc ) );
+               s = mlt_properties_serialise_yaml( doc );
+               fprintf( stdout, "%s", s );
+               free( s );
                mlt_properties_close( doc );
                error = 1;
        }
@@ -274,7 +278,9 @@ static int consumer_start( mlt_consumer consumer )
                                snprintf( key, sizeof(key), "%d", mlt_properties_count( codecs ) );
                                mlt_properties_set( codecs, key, codec->name );
                        }
-               fprintf( stdout, "%s", mlt_properties_serialise_yaml( doc ) );
+               s = mlt_properties_serialise_yaml( doc );
+               fprintf( stdout, "%s", s );
+               free( s );
                mlt_properties_close( doc );
                error = 1;
        }