free( tmp_buffer );
tmp_url = (char *) malloc( strlen( "rtmp://") + strlen( p_thread->url.psz_buffer ) + 1 );
- /* FIXME: Handle error case when malloc FAILS */
+ if( !tmp_url )
+ {
+ free( rtmp_body->body );
+ free( rtmp_body );
+ return -1;
+ }
sprintf( tmp_url, "rtmp://%s", p_thread->url.psz_buffer );
tmp_buffer = amf_encode_object_variable( "tcUrl",
AMF_DATATYPE_STRING, tmp_url );
free( tmp_buffer );
description = (char *) malloc( strlen( "Playing and resetting ") + strlen( psz_media ) + strlen( "." ) + 1 );
- /* FIXME: Handle error case when malloc FAILS */
-
+ if( !description )
+ {
+ free( rtmp_body->body );
+ free( rtmp_body );
+ return NULL;
+ }
sprintf( description, "Playing and resetting %s.", psz_media );
tmp_buffer = amf_encode_object_variable( "description",
AMF_DATATYPE_STRING, description );
free( tmp_buffer );
description = (char *) malloc( strlen( "Started playing ") + strlen( psz_media ) + strlen( "." ) + 1 );
- /* FIXME: Handle error case when MALLOC FAILS */
+ if( !description )
+ {
+ free( rtmp_body->body );
+ free( rtmp_body );
+ return NULL;
+ }
sprintf( description, "Started playing %s.", psz_media );
tmp_buffer = amf_encode_object_variable( "description",