Commit f1aea67d authored by Alexandre Julliard's avatar Alexandre Julliard

winspool.drv: Don't crash if the ppd directory cannot be created.

parent 50cdc6d7
...@@ -946,7 +946,11 @@ static BOOL CUPS_LoadPrinters(void) ...@@ -946,7 +946,11 @@ static BOOL CUPS_LoadPrinters(void)
} else { } else {
BOOL added_driver = FALSE; BOOL added_driver = FALSE;
if (!ppd_dir) ppd_dir = get_ppd_dir(); if (!ppd_dir && !(ppd_dir = get_ppd_dir()))
{
HeapFree( GetProcessHeap(), 0, port );
break;
}
ppd = get_ppd_filename( ppd_dir, nameW ); ppd = get_ppd_filename( ppd_dir, nameW );
if (get_cups_ppd( dests[i].name, ppd )) if (get_cups_ppd( dests[i].name, ppd ))
{ {
...@@ -1098,7 +1102,11 @@ static BOOL update_driver( HANDLE printer ) ...@@ -1098,7 +1102,11 @@ static BOOL update_driver( HANDLE printer )
queue_name = get_queue_name( printer, &is_cups ); queue_name = get_queue_name( printer, &is_cups );
if (!queue_name) return FALSE; if (!queue_name) return FALSE;
ppd_dir = get_ppd_dir(); if (!(ppd_dir = get_ppd_dir()))
{
HeapFree( GetProcessHeap(), 0, queue_name );
return FALSE;
}
ppd = get_ppd_filename( ppd_dir, name ); ppd = get_ppd_filename( ppd_dir, name );
#ifdef SONAME_LIBCUPS #ifdef SONAME_LIBCUPS
...@@ -1224,7 +1232,7 @@ static BOOL PRINTCAP_ParseEntry( const char *pent, BOOL isfirst ) ...@@ -1224,7 +1232,7 @@ static BOOL PRINTCAP_ParseEntry( const char *pent, BOOL isfirst )
sep_file[] = "<sep file?>"; sep_file[] = "<sep file?>";
BOOL added_driver = FALSE; BOOL added_driver = FALSE;
if (!ppd_dir) ppd_dir = get_ppd_dir(); if (!ppd_dir && !(ppd_dir = get_ppd_dir())) goto end;
ppd = get_ppd_filename( ppd_dir, devnameW ); ppd = get_ppd_filename( ppd_dir, devnameW );
if (get_fallback_ppd( devname, ppd )) if (get_fallback_ppd( devname, ppd ))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment