Permalink
Browse files

Fix minor memory leak found with valgrind.

  • Loading branch information...
1 parent c657289 commit ce8a84e666e389e3f865b895f9c9301b7b8257c7 @ddennedy ddennedy committed Nov 24, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/modules/avformat/consumer_avformat.c
@@ -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;
}

0 comments on commit ce8a84e

Please sign in to comment.