Commit bd6877f9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix memory leak (CID 92)

parent a0f44bd5
...@@ -118,7 +118,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self, ...@@ -118,7 +118,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
if( ! p_input ) if( ! p_input )
{ {
RAISE( mediacontrol_InternalException, "No input thread." ); RAISE( mediacontrol_InternalException, "No input thread." );
return NULL; goto error;
} }
if( an_origin != mediacontrol_AbsolutePosition ) if( an_origin != mediacontrol_AbsolutePosition )
...@@ -126,7 +126,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self, ...@@ -126,7 +126,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
/* Relative or ModuloPosition make no sense */ /* Relative or ModuloPosition make no sense */
RAISE( mediacontrol_PositionOriginNotSupported, RAISE( mediacontrol_PositionOriginNotSupported,
"Only absolute position is valid." ); "Only absolute position is valid." );
return NULL; goto error;
} }
/* We are asked for an AbsolutePosition. */ /* We are asked for an AbsolutePosition. */
...@@ -139,6 +139,9 @@ mediacontrol_get_media_position( mediacontrol_Instance *self, ...@@ -139,6 +139,9 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
a_key, a_key,
val.i_time / 1000 ); val.i_time / 1000 );
return retval; return retval;
error:
free( retval );
return NULL;
} }
/* Sets the media position */ /* Sets the media position */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment