< prev index next >

src/java.desktop/unix/native/common/awt/fontpath.c

Print this page

        

*** 206,216 **** doNotAppend = 0; if ( fDirP->num == 0 ) return; ! appendDirList = SAFE_SIZE_ARRAY_ALLOC(malloc, fDirP->num, sizeof ( int )); if ( appendDirList == NULL ) { return; /* if it fails we cannot do much */ } origFontPath = XGetFontPath ( awt_display, &nPaths ); --- 206,216 ---- doNotAppend = 0; if ( fDirP->num == 0 ) return; ! appendDirList = SAFE_SIZE_ARRAY_ALLOC(malloc, fDirP->num, (int)sizeof ( int )); if ( appendDirList == NULL ) { return; /* if it fails we cannot do much */ } origFontPath = XGetFontPath ( awt_display, &nPaths );
*** 263,273 **** XFreeFontPath ( origFontPath ); return; } ! newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, sizeof(char *)); /* if it fails free things and get out */ if ( newFontPath == NULL ) { free ( ( void *) appendDirList ); XFreeFontPath ( origFontPath ); return; --- 263,273 ---- XFreeFontPath ( origFontPath ); return; } ! newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, (int)sizeof(char *)); /* if it fails free things and get out */ if ( newFontPath == NULL ) { free ( ( void *) appendDirList ); XFreeFontPath ( origFontPath ); return;
*** 284,294 **** if ( appendDirList[index] == 1 ) { /* printf ( "Appending %s\n", fDirP->name[index] ); */ ! onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) ); if (onePath == NULL) { free ( ( void *) appendDirList ); for ( index = origIndex; index < nPaths; index++ ) { free( newFontPath[index] ); --- 284,294 ---- if ( appendDirList[index] == 1 ) { /* printf ( "Appending %s\n", fDirP->name[index] ); */ ! onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, (int)strlen (fDirP->name[index]) + 2, (int)sizeof( char ) ); if (onePath == NULL) { free ( ( void *) appendDirList ); for ( index = origIndex; index < nPaths; index++ ) { free( newFontPath[index] );
< prev index next >