Reset pointer to NULL after free'ing.

This commit is contained in:
Dave Davenport 2017-04-04 08:31:25 +02:00
parent 39327a3197
commit 358759e0ab
2 changed files with 3 additions and 0 deletions

View File

@ -574,6 +574,7 @@ gboolean rofi_theme_parse_file ( const char *file )
g_list_foreach ( imported_files, (GFunc)g_free, NULL);
g_list_free ( imported_files );
g_queue_free ( file_queue );
imported_files = NULL;
file_queue = NULL;
if ( parser_retv != 0 ) {
return TRUE;
@ -600,6 +601,7 @@ gboolean rofi_theme_parse_string ( const char *string )
// Free up.
g_list_foreach ( imported_files, (GFunc)g_free, NULL);
g_list_free ( imported_files );
imported_files = NULL;
g_queue_free ( file_queue );
file_queue = NULL;
if ( parser_retv != 0 ) {

View File

@ -280,6 +280,7 @@ void yyerror ( YYLTYPE *yylloc, const char *what, const char* s )
g_string_append_printf ( str, "\tLocation: line %d column %d to line %d column %d\n", yylloc->first_line, yylloc->first_column, yylloc->last_line, yylloc->last_column );
}
rofi_add_error_message ( str );
g_log ( "Parser", G_LOG_LEVEL_DEBUG, "Failed to parse theme:\n%s", str->str );
}
static gboolean rofi_theme_steal_property_int ( gpointer key, gpointer value, gpointer user_data )