summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xine-engine/osd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index 62117b6d4..7a27ccb7d 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -655,7 +655,7 @@ static int osd_renderer_load_font(osd_renderer_t *this, char *filename) {
*/
static int osd_renderer_unload_font(osd_renderer_t *this, char *fontname ) {
- osd_font_t *font, *first, *last;
+ osd_font_t *font, *last;
osd_object_t *osd;
int i, ret = 0;
@@ -671,7 +671,7 @@ static int osd_renderer_unload_font(osd_renderer_t *this, char *fontname ) {
}
last = NULL;
- font = first = this->fonts;
+ font = this->fonts;
while( font ) {
if ( !strcasecmp(font->name,fontname) ) {
@@ -688,17 +688,17 @@ static int osd_renderer_unload_font(osd_renderer_t *this, char *fontname ) {
last->next = font->next;
else
this->fonts = font->next;
+
free( font );
ret = 1;
break;
}
+
last = font;
- font = font->next;
+ free(font);
+ font = last->next;
}
- if(first)
- free(first);
-
pthread_mutex_unlock (&this->osd_mutex);
return ret;
}