X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_gfx.c;h=1d46a858243d830f8536e6afafefbb385aaab119;hb=be67fb36af7b40e2cb388a4d8a1f3cc0bdba90b2;hp=da1255449196ff66f8dcd41d9a1fb9fc039e6575;hpb=aa4d951ab71eb7fe57840c3baaddf36809806aef;p=rrdtool.git diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index da12554..1d46a85 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2.10 Copyright by Tobi Oetiker, 1997-2005 + * RRDtool 1.2.11 Copyright by Tobi Oetiker, 1997-2005 **************************************************************************** * rrd_gfx.c graphics wrapper for rrdtool **************************************************************************/ @@ -303,10 +303,15 @@ double gfx_get_text_width_libart ( FT_Init_FreeType( &library ); error = FT_New_Face( library, font, 0, &face ); - if ( error ) return -1; + if ( error ) { + FT_Done_FreeType(library); + return -1; + } error = FT_Set_Char_Size(face, size*64,size*64, 100,100); - if ( error ) return -1; - + if ( error ) { + FT_Done_FreeType(library); + return -1; + } string = gfx_string_create( canvas, face, text, rotation, tabwidth, size ); text_width = string->width; gfx_string_destroy(string); @@ -602,6 +607,7 @@ int gfx_render_png (gfx_canvas_t *canvas, &face ); if ( error ) { rrd_set_error("failed to load %s",node->filename); + break; } error = FT_Set_Char_Size(face, /* handle to face object */