From 9886283e3a45d12e124fce3f10acfba84eea763a Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sun, 19 Aug 2012 13:24:30 -0700 Subject: [PATCH] fix possible null pointer with strdup() --- src/modules/xml/consumer_xml.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 ) -- 2.39.2