Buggy code:
public final class Printer extends Device { static PrinterData [ ] printerList ; PrinterData data ; int printer ; int printJob ; int settings ; int pageSetup ; int surface ; int cairo ; boolean isGCCreated = false ; Font systemFont ; byte [ ] settingsData ; int start ; int end ; static final String GTK_LPR_BACKEND = "GtkPrintBackendLpr" ; static boolean disablePrinting = ( System . getProperty ( "org.eclipse.swt.internal.gtk.disablePrinting" ) ) != null ; public static PrinterData [ ] getPrinterList ( ) { } static int GtkPrinterFunc_List ( int printer , int user_data ) { } public static PrinterData getDefaultPrinterData ( ) { } static int GtkPrinterFunc_Default ( int printer , int user_data ) { } int gtkPrinterFromPrinterData ( ) { } int GtkPrinterFunc_FindNamedPrinter ( int printer , int user_data ) { } static PrinterData printerDataFromGtkPrinter ( int printer ) { } static void setScope ( int settings , int scope , int startPage , int endPage ) { } static DeviceData checkNull ( PrinterData data ) { } public Printer ( ) { } public Printer ( PrinterData data ) { } int restoreInt ( String key ) { } double restoreDouble ( String key ) { } boolean restoreBoolean ( String key ) { } byte [ ] restoreBytes ( String key , boolean nullTerminate ) { } public Font getSystemFont ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int gdkGC , GCData data ) { } protected void release ( ) { } public boolean startJob ( String jobName ) { } protected void destroy ( ) { } public void endJob ( ) { } public void cancelJob ( ) { } public boolean startPage ( ) { } public void endPage ( ) { } public Point getDPI ( ) { } public Rectangle getBounds ( ) { } public Rectangle getClientArea ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } protected void create ( DeviceData deviceData ) { } protected void init ( ) { super . init ( ) ; settings = OS . gtk_print_settings_new ( ) ; pageSetup = OS . gtk_page_setup_new ( ) ; if ( ( data . otherData ) != null ) { settingsData = data . otherData ; start = end = 0 ; while ( ( ( end ) < ( settingsData . length ) ) && ( ( settingsData [ end ] ) != 0 ) ) { start = end ; while ( ( ( end ) < ( settingsData . length ) ) && ( ( settingsData [ end ] ) != 0 ) ) ( end ) ++ ; ( end ) ++ ; byte [ ] keyBuffer = new byte [ ( end ) - ( start ) ] ; System . arraycopy ( settingsData , start , keyBuffer , 0 , keyBuffer . length ) ; start = end ; while ( ( ( end ) < ( settingsData . length ) ) && ( ( settingsData [ end ] ) != 0 ) ) ( end ) ++ ; ( end ) ++ ; byte [ ] valueBuffer = new byte [ ( end ) - ( start ) ] ; System . arraycopy ( settingsData , start , valueBuffer , 0 , valueBuffer . length ) ; OS . gtk_print_settings_set ( settings , keyBuffer , valueBuffer ) ; if ( DEBUG ) System . out . println ( ( ( ( new String ( Converter . mbcsToWcs ( null , keyBuffer ) ) ) + ":<seq2seq4repair_space>" ) + ( new String ( Converter . mbcsToWcs ( null , valueBuffer ) ) ) ) ) ; } ( end ) ++ ; OS . gtk_page_setup_set_orientation ( pageSetup , restoreInt ( "orientation" ) ) ; OS . gtk_page_setup_set_top_margin ( pageSetup , restoreDouble ( "top_margin" ) , GTK_UNIT_MM ) ; OS . gtk_page_setup_set_bottom_margin ( pageSetup , restoreDouble ( "bottom_margin" ) , GTK_UNIT_MM ) ; OS . gtk_page_setup_set_left_margin ( pageSetup , restoreDouble ( "left_margin" ) , GTK_UNIT_MM ) ; OS . gtk_page_setup_set_right_margin ( pageSetup , restoreDouble ( "right_margin" ) , GTK_UNIT_MM ) ; byte [ ] name = restoreBytes ( "paper_size_name" , true ) ; byte [ ] display_name = restoreBytes ( "paper_size_display_name" , true ) ; byte [ ] ppd_name = restoreBytes ( "paper_size_ppd_name" , true ) ; double width = restoreDouble ( "paper_size_width" ) ; double height = restoreDouble ( "paper_size_height" ) ; boolean custom = restoreBoolean ( "paper_size_is_custom" ) ; int paper_size = 0 ; if ( custom ) { if ( ( ppd_name . length ) > 0 ) { paper_size = OS . gtk_paper_size_new_from_ppd ( ppd_name , display_name , width , height ) ; } else { paper_size = OS . gtk_paper_size_new_custom ( name , display_name , width , height , GTK_UNIT_MM ) ; } } else { paper_size = OS . gtk_paper_size_new ( name ) ; } OS . gtk_page_setup_set_paper_size ( pageSetup , paper_size ) ; <START_BUG> OS . g_free ( paper_size ) ; <END_BUG> } Printer . setScope ( settings , data . scope , data . startPage , data . endPage ) ; if ( data . printToFile ) { byte [ ] buffer = Converter . wcsToMbcs ( null , data . fileName , true ) ; OS . gtk_print_settings_set ( settings , GTK_PRINT_SETTINGS_OUTPUT_URI , buffer ) ; } if ( ( data . driver . equals ( "GtkPrintBackendFile" ) ) && ( data . name . equals ( "Print<seq2seq4repair_space>to<seq2seq4repair_space>File" ) ) ) { byte [ ] buffer = Converter . wcsToMbcs ( null , data . fileName , true ) ; OS . gtk_print_settings_set ( settings , GTK_PRINT_SETTINGS_OUTPUT_URI , buffer ) ; } OS . gtk_print_settings_set_n_copies ( settings , data . copyCount ) ; OS . gtk_print_settings_set_collate ( settings , data . collate ) ; } public PrinterData getPrinterData ( ) { } }

Fix:
OS . gtk_paper_size_free ( paper_size ) ;