Fix small leak

This commit is contained in:
QC 2015-09-26 21:06:36 +02:00
parent 6e41457250
commit e8328beb2d
2 changed files with 5 additions and 5 deletions

View file

@ -146,6 +146,9 @@ static char **read_known_hosts_file ( char ** retv, unsigned int *length )
}
}
}
if ( fclose ( fd ) != 0 ) {
fprintf ( stderr, "Failed to close hosts file: '%s'\n", strerror ( errno ) );
}
}
g_free ( path );

View file

@ -643,24 +643,22 @@ static void menu_keyboard_navigation ( MenuState *state, KeySym key, unsigned in
* mouse navigation through the elements.
*
*/
static int intersect ( textbox *tb, int x, int y )
static int intersect ( const textbox *tb, int x, int y )
{
if ( x >= ( tb->x ) && x < ( tb->x + tb->w ) ) {
if ( y >= ( tb->y ) && y < ( tb->y + tb->h ) ) {
return TRUE;
}
}
return FALSE;
}
static int sb_intersect ( scrollbar *tb, int x, int y )
static int sb_intersect ( const scrollbar *tb, int x, int y )
{
if ( x >= ( tb->x ) && x < ( tb->x + tb->w ) ) {
if ( y >= ( tb->y ) && y < ( tb->y + tb->h ) ) {
return TRUE;
}
}
return FALSE;
}
static void menu_mouse_navigation ( MenuState *state, XButtonEvent *xbe )
@ -768,7 +766,6 @@ static void menu_refilter ( MenuState *state )
static void menu_draw ( MenuState *state, cairo_t *draw )
{
unsigned int i, offset = 0;
unsigned pixel = color_background ( display );
cairo_set_source_rgba ( draw,