From: Dan Dennedy Date: Sun, 19 Aug 2012 20:24:30 +0000 (-0700) Subject: fix possible null pointer with strdup() X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9886283e3a45d12e124fce3f10acfba84eea763a;p=mlt fix possible null pointer with strdup() --- diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c index 883ee7de..0b308e0c 100644 --- a/src/modules/xml/consumer_xml.c +++ b/src/modules/xml/consumer_xml.c @@ -235,8 +235,14 @@ static void serialise_properties( serialise_context context, mlt_properties prop strcmp( name, "height" ) ) { char *value; + fprintf(stderr, "serializing %s=%s (%d)\n", name, mlt_properties_get( properties, name ), + context->time_format); if ( !strcmp( name, "length" ) ) - value = strdup( mlt_properties_get_time( properties, name, context->time_format ) ); + { + char *time = mlt_properties_get_time( properties, name, context->time_format ); + if ( time ) + value = strdup( time ); + } else value = filter_restricted( mlt_properties_get_value( properties, i ) ); if ( value )